This topic is locked

How can I log in as the Admin?

1/12/2011 11:29:32 AM
PHPRunner General questions
K
komlos author

How can I log in as the Admin?

Apparently I can only log in as a default user (I can only see the tables that the default user has access to).

Security is configured to use username and password from database. I use static permissions. I have created GroupID field in my "users" mysql table, I use the default group with permissions to certain tables and also created admin group "Admin" with permission to all the tables, and also checked the checkbox below "Admin group" for the group "Admin". My "users" table was empty, so I inserted a user through phpMyAdmin. I tried to change the GroupID of the user to -1, -2, 1, 0 directly in the table, but none of them worked.
Another problem is that right after I log in it gives me a 404 not found page. When I type the address of the list page of my table manually it works fine, and I can see I am logged in, and I can access any page.

Also when I enter just the base URL of my project without any page after the slash, it redirects me to the login page even if I am logged in...

Sergey Kornilov admin 1/12/2011

When you create a user manually you need to populate GroupID field. Since group name is Admin you need to put 'Admin' value there.
Hard to tell what might be wrong with the second issue without seeing your files. I suggest to to post your application to Demo Account and open a ticket at http://support.xlinesoft.com sending your Demo Account URL. 'Demo Account' button can be found on the last screen in the program.

K
komlos author 1/12/2011

Thanks! Now it works. The problem was that I first didn't have a groupid field so PHPRunner offered me to create one, but it created an "INT" type field by default, that's why I thought groupids are digits. It doesn't say about the type of field in the manual. Now I changed it to VARCHAR and entered "Admin".

K
komlos author 1/12/2011



Another problem is that right after I log in it gives me a 404 not found page. When I type the address of the list page of my table manually it works fine, and I can see I am logged in, and I can access any page.

Also when I enter just the base URL of my project without any page after the slash, it redirects me to the login page even if I am logged in...


I found out what the problem was. In the "After successful login" event by default there is a redirect to "anypage.php". I had to modify that to redirect to one of the existing pages.

The second problem is because in the generated project folder PHPRunner creates an "index.htm" that redirects to "login.php". Why is this file there? How can I disable the generation of this file?

Sergey Kornilov admin 1/12/2011

index.htm file is there for a reason. When someone opens http://yourwebsite.com/folder index.htm will be loaded. If this file is not there you'll see the list of files or an error message.
If you 100% sure you don't need it modify C:\Program Files\PHPRunner5.3\source\files.txt file removing the following line:

index.htm index.htm
K
komlos author 1/13/2011

The problem is that it redirects to login page even if I'm logged in...

Sergey Kornilov admin 1/13/2011

index.htm redirects user to the list page (if you only have one table) or to the menu page.
Once you are logged in you should not see index.htm at all. Could you describe your scenario? Something doesn't sound right here.

K
komlos author 1/16/2011

OK. Every time I tried to log in, the browser gave me a 404 page not found error. It was because after login it redirected me to a non-existing page called "anypage.php". So I had to input the name of my list page manually into the browser's address field.

Later I found out that in the event "After successful login" there was a line that redirected to this "anypage.php". So I changed this to redirect to one of my list page. Now it works. After login it redirects me to that list page.
However I tried what happens if I type my base folder in the browser like http://localhost/myproject

It redirects me to the login page even I'm logged in. So I checked the source of index.htm and there is a meta-refresh to login page.

Thanks.

Sergey Kornilov admin 1/16/2011

I guess you can modify index.htm pointing it to any list page or to menu page.
In regards to "anypage.php" redirect - I guess you added sample redirect event code to AfterSuccessfulLogin event without realizing it.

K
komlos author 1/17/2011

That means I have to modify it every time I generate the files??
No, I'm sure I haven't added code!

Sergey Kornilov admin 1/17/2011

No, there is no need to modify index.htm every time. In fact, it should never point to login.php page. By default it points to the first page of the application (menu or list page). If this is not happening - send us the whole project directory for investigation via http://support.xlinesoft.com