Login to admin

Help with installation and general calendar setttings

Login to admin

Postby Yor » Fri Oct 22, 2010 9:51 am

Hello there...

I have a question concerning the admin-login page.
I have a site on which a administrator can login to to change certain things links a photo-page, a ftp-database and the calendar.
I have my own login-page on which the administrator has to login.
I work with sessions to keep the admin logged-in.
How can i intergrate the login-age of the calendar to my own login.
I just can't get the sessions to work so the calendar-admin-page is show instead of the login-page of the calendar.

Please help... :)
Yor
 
Posts: 5
Joined: Tue Oct 19, 2010 12:06 pm

Re: Login to admin

Postby chris » Fri Oct 22, 2010 7:49 pm

Hello,
Clearly the exact solution will depend on how your existing system works.

To remove the basic login requirements you need to remove the control in the ac-admin > index.php file that checks that the user is logged in.
This is the line that you need to look for:
Code: Select all
if(!isset($_SESSION["admin_id"]))   $_REQUEST["page"]="admin-login";

So, removing that will allow the pages to be shown.... or not...
You do actually need the $_SESSION["admin_id"] as this is used to retrieve the correct calendars (for users). So again you will need to define this to hold the value of your existing user id session value (please don't say you don't have one):
Code: Select all
$_SESSION["admin_id"] =$_SESSION["_your_sesssion_id_variable_"];


The problem is that the menu and individual page permission is also controlled via a session variable.
There are 2 admin levels - one for the main administrator who has control of general settings etc. and another one for the "users" who can bascially just administrate their calendars.
With the default login system this variable is defined if the user logs in successfully.
However in your case you are going to need to "force" it aswell.
In this same admin file, and before all the other files are includeded (i.e. at the top) you need to define this session variable according to your admin user type (I assume that your system also has something similar)
This is what you need to define:
Code: Select all
$_SESSION["admin_level"]=1

or
Code: Select all
$_SESSION["admin_level"]=2

Where "1" us for the main admin and "2" is for the users.

I hope you can follow all that and are able to adjust it to your specific needs.

Chris
User avatar
chris
Site Admin
 
Posts: 1089
Joined: Mon Dec 17, 2007 7:42 pm
Location: Málaga, Spain


Return to Support

Who is online

Users browsing this forum: Bing [Bot] and 1 guest

cron