Intranet Journal

Go Back   IT Management Forum > Intranet Journal

Intranet Journal The new discussion forum for Intranet Journal readers. Leave comments and questions for IJ authors. Suggest story ideas and provide feedback.

Reply
 
LinkBack Thread Tools Rate Thread Display Modes
  #1 (permalink)  
Old 03-11-2010, 05:03 AM
amanda-moon amanda-moon is offline
Registered User
 
Join Date: Mar 2010
Posts: 1
CMS 5 how to access multiple page

hello: i use this CMS tutorial Part 5 .
i made it work. when i open login.php,input username,pass,it go to welcome to admin area.

then i made some change. i want use that sentry code to my website access multiple pages, different users depend on group, login themself pages.

this is i made change login.php code:

<?php
require_once("../includes/Sentry.php");

$sentry = new Sentry();
if ($HTTP_POST_VARS['user'] != '){
switch($HTTP_POST_VARS['thegroup']){
case 1:
$sentry->checkLogin($HTTP_POST_VARS['user'],$HTTP_POST_VARS['pass'],1,'welcome.php','failed.php');break;
case 2:
$sentry->checkLogin($HTTP_POST_VARS['user'],$HTTP_POST_VARS['pass'],2,'welcome2.php','failed.php');break;
case 3:
$sentry->checkLogin($HTTP_POST_VARS['user'],$HTTP_POST_VARS['pass'],3,'welcome3.php','failed.php');break;
}
}
elseif($HTTP_POST_VARS['enabled']=0){

?>
<script language="javascript">
alert("i am sorry, you are no allow login!");window.location.href="login.php";
</script>
<?php

}
?>

<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>

<body>
<table width="25%" border="1" align="center" cellpadding="0" cellspacing="0" bordercolor="#000066">
<tr>
<td align="center" bgcolor="#000066"><font color="#FFFFFF" size="2" face="Verdana, Arial, Helvetica, sans-serif"><strong>Login</strong></font></td>
</tr>
<tr>
<td bordercolor="#FFFFFF"><form name="form1" method="post" action="login.php">
<br/><br/><font size="2" face="Verdana, Arial, Helvetica, sans-serif"><br>
User:
<input type="text" name="user">
</font></p>
<br/><br/><font size="2" face="Verdana, Arial, Helvetica, sans-serif"> Pass:
<input type="password" name="pass">
</font></p>
<p align="center"><font size="2" face="Verdana, Arial, Helvetica, sans-serif">
<input type="submit" name="Submit2" value="Submit">
</font></p>
</form>
<div align="right"><font size="2" face="Verdana, Arial, Helvetica, sans-serif"><a href="login.php?action=logout">Logout</a> </font></div>
</td>
</tr>
</table>
</body>
</html>
_____________
welcome.php
<?php
require_once('../includes/Sentry.php');
$theSentry = new Sentry();
if (!$theSentry->checkLogin(2) ){ header("Location: login.php"); die(); }
?>
<html>
<head>
<title>Welcome</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>

<body>
Welcome to the admin area
</body>
</html>
__________________
welcome2.php
<?php
require_once('../includes/Sentry.php');
$theSentry = new Sentry();
if (!$theSentry->checkLogin(2)){ header("Location: login.php"); die(); }
?>
<html>
<head>
<title>Welcome</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>

<body>
Law Firm INTRANET page
</body>
</html>
_________________
welcome3.php
<?php
require_once('../includes/Sentry.php');
$theSentry = new Sentry();
if (!$theSentry->checkLogin(2) ){ header("Location: login.php"); die(); }
?>
<html>
<head>
<title>Welcome</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>

<body>
Welcome to the user area
</body>
</html>
_______________
when i try input username,pass, it does not go to any welcome pages,always stay at login.php page
does anyone can help me?
thanks lots of
Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -5. The time now is 09:27 AM.





Acceptable Use Policy

Internet.com
The Network for Technology Professionals

Search:

About Internet.com

Legal Notices, Licensing, Permissions, Privacy Policy.
Advertise | Newsletters | E-mail Offers

Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.0.0