mirror of
https://github.com/tuxis-ie/nsedit.git
synced 2026-04-26 16:15:54 +03:00
[GH-ISSUE #7] unable to login to nsedit #1
Labels
No labels
bug
duplicate
enhancement
help wanted
invalid
pull-request
question
question
upstream
upstream
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/nsedit#1
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @rpenugonda on GitHub (Oct 21, 2014).
Original GitHub issue: https://github.com/tuxis-ie/nsedit/issues/7
Hi installed nsedit and tried to login with admin/admin and never gets authenticated.
PHP Notice: Use of undefined constant CSRF_TOKEN - assumed 'CSRF_TOKEN' in /home/rpenugonda/nsedit/index.php on line 125
Also i am able to see the user in the DB itself
sqlite> select * from users;
1|admin|$6$41f03d9acdc52ee6$nSYlWjbZ1MXO.9j//.Mz4RJTB.uS51k4FTlVzvsE3jFTFtncxKIdCKWlZcHJdkCv4Dhuzto9e7zdSD7CFM1u20|1
@tuxis-ie commented on GitHub (Oct 21, 2014):
Hi,
Did you set the $secret-value in config.inc.php? It might be that you're missing hash_pbkdf2. What happens if you unset $secret?
@rpenugonda commented on GitHub (Oct 21, 2014):
i removed it (i was playing with it etc..) still the same here is my config.
###########
'Tuxis', 'owner' => 'username', # Set to 'public' to make it available to all users 'records' => array( array( 'name' => '', 'type' => 'MX', 'content' => 'mx2.tuxis.nl', 'priority' => '200') ) ); */ $defaults['soa_edit'] = 'INCEPTION-INCREMENT'; $defaults['soa_edit_api'] = 'INCEPTION-INCREMENT'; $defaults['defaulttype'] = 'Master'; # Choose between 'Native' or 'Master' $defaults['primaryns'] = 'unconfigured.primaryns'; # The value of the first NS-record $defaults['secondaryns'] = 'unconfigured.secondaryns'; # The value of the second NS-record $defaults['ttl'] = 3600; # Default TTL for records $defaults['priority'] = 0; # Default for priority in records /\* No need to change stuf below */ $defaults['defaulttype'] = ucfirst(strtolower($defaults['defaulttype'])); if (!file_exists($authdb)) { is_dir(dirname($authdb)) || mkdir(dirname($authdb)); $db = new SQLite3($authdb, SQLITE3_OPEN_CREATE|SQLITE3_OPEN_READWRITE); $createsql = file_get_contents('includes/scheme.sql'); $db->exec($createsql); $salt = bin2hex(openssl_random_pseudo_bytes(16)); $db->exec("INSERT INTO users (emailaddress, password, isadmin) VALUES ('admin', '".crypt("admin", '$6$'.$salt)."', 1)"); } ##############@rpenugonda commented on GitHub (Oct 21, 2014):
I made sure the API works by using below.
curl -X PATCH --data '{ "rrsets": [ { "name": "ramesh.example.org", "type": "A", "changetype": "REPLACE", "records": [ { "content": "12.2.3.4", "name": "ramesh.example.org", "ttl": 3600, "priority": 1, "type": "A", "disabled": false} ] } ] }' -v http://a:changeme@10.22.7.79:8081/servers/localhost/zones/example.org.
@tuxis-ie commented on GitHub (Oct 21, 2014):
Ok. Are you sure that you're not seeing any other error messages in the webserver errorlog? Which version of php on which OS are you running?
@rpenugonda commented on GitHub (Oct 21, 2014):
@rpenugonda commented on GitHub (Oct 21, 2014):
[root@pdns-testvm1 rpenugonda]# php -v
PHP 5.3.6 (cli) (built: Jun 13 2011 12:44:31)
Copyright (c) 1997-2011 The PHP Group
Zend Engine v2.3.0, Copyright (c) 1998-2011 Zend Technologies
[root@pdns-testvm1 ]# uname -a
Linux pdns-testvm1 2.6.32-431.el6.x86_64 #1 SMP Fri Nov 22 03:15:09 UTC 2013 x86_64 x86_64 x86_64 GNU/Linux
[root@pdns-testvm1 ]# cat /etc/redhat-release
CentOS release 6.5 (Final)
this is the only error i am seeing.
[Tue Oct 21 21:20:27 2014] [error] [client 10.60.128.96] PHP Notice: Use of undefined constant CSRF_TOKEN - assumed 'CSRF_TOKEN' in /home/rpenugonda/nsedit/index.php on line 125
@tuxis-ie commented on GitHub (Oct 21, 2014):
ok. Ehm, are you sure that you have php enabled in your webserver? The screendump you post looks exactly like what I see when I look at index.php without php enabled..
@rpenugonda commented on GitHub (Oct 22, 2014):
I created a version.php and got this, seems to be php is enabled (not sure if i am missing anything)

@tuxis-ie commented on GitHub (Oct 22, 2014):
Are you running nginx and php-fpm? You're testing version.php directly via port 9000, which is a default for php-fpm.
You need to tell (or Apache) that they should push php through fpm..
@rpenugonda commented on GitHub (Oct 22, 2014):
it's apache and php, I had to ssh tunnel it etc.. to bypass the firewall. Is there a debug flag i can set so that i can see more info in the logs. Also i should be able to login irrespective of powerdns correct. does nsedit expose powerdns API with user acls etc..
@tuxis-ie commented on GitHub (Oct 22, 2014):
ok, found it. Please set 'short_open_tag' to 'On' ....
@rpenugonda commented on GitHub (Oct 22, 2014):
thank you it works now.
Also does nsedit augment any API powerdns already provides like, having multiple api users, privileges etc..
@rpenugonda commented on GitHub (Oct 23, 2014):
now i get a different error

so i pulled an older version of zones.php (

c5ae169b2d) and that works.@tuxis-ie commented on GitHub (Oct 23, 2014):
That bug is now fixed in
b035bfd52a. Sorry about that.