PEAR Forum :: PHP Extension and Application Repository

PEAR Forum Forum Index
 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister   ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
AUTH how tu use in more admin sides?

 
Post new topic   Reply to topic    PEAR Forum Forum Index -> Documantion, Tutorials, How to's
View previous topic :: View next topic  
Author Message
imot



Joined: 25 Sep 2007
Posts: 1

PostPosted: Tue Sep 25, 2007 5:26 pm    Post subject: AUTH how tu use in more admin sides? Reply with quote

I am using PEAR AUTH

I cant link admin2 from admin1 because i have to login.

What is the problem?




************************************************************
* 1. hitelesit.inc included file
***********************************************************
<?php

require_once "class_ab.inc";

$abobj = new AB();
$dsn=$abobj->ab_csatlakozas();
require_once("Auth/Auth.php");

function handle_pear_error($e) {
die($e->getMessage() . ' ' . print_r($e->getUserInfo(), true));
}

PEAR::setErrorHandling(PEAR_ERROR_CALLBACK, 'handle_pear_error');


$parameterek = array(
"dsn" => $dsn,
"table" => "t_felhasznalok",
"usernamecol" => "fel_usernev",
"passwordcol" => "fel_jelszo",
"db_fields"=>"*",
"cryptType" => "md5"
);

function belepes_form() {

echo '<form method="post" ACTION="' . $_SERVER['PHP_SELF'] . '?login=1">
<table class="tablazat">
<tr>
<td>
Felhasználó
</td>
<td>
<input type="text" name="username" />
</td>
</tr>
<tr>
<td>
Jelszó
</td>
<td>
<input type="password" name="password" />
</td>
</tr>
<tr>
<td>
<input type="submit" value="Belépés" />
</td>
</tr>
</table>
</form><br />
';

}//function belepes_form()


$a = new Auth("DB", $parameterek,"belepes_form");
$a->setSessionname("valami");
$a->start();

//if (isset($_SESSION['_authsession']) && isset($_SESSION['_authsession']['registered']) && $_SESSION['_authsession']['registered'] == true)
?>


***********************************************************************************
* 1. admin1.php
***********************************************************************************
<?php
session_start();
require_once '../includes/hitelesit.inc';

if ($a->checkAuth()) {

print_r($_SESSION);

print "you are logged in in admin1";

print "<a href=admin2.php>admin2</a>";

}else{
print "not logged in admin1";
print_r($_SESSION);

}

?>

**********************************************************************************
* 2. admin2.php
**********************************************************************************
<?php

require_once '../includes/hitelesit.inc';



$_SESSION['_authsession']=session_decode($_SESSION['as']);


if ($a->checkAuth()) {
print_r($_SESSION);
print "you are logged in in admin2";
print "<a href=".$_SERVER['PHP_SELF'].">self</a>";
//$abobj->felhasznalok();

}else{
print "not logged in admin2";
print_r($_SESSION);
}



?>
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    PEAR Forum Forum Index -> Documantion, Tutorials, How to's All times are GMT + 2 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum



PEAR Forum topic RSS feed 
Powered by phpBB © 2001, 2005 phpBB Group

Provided by Ministry of Web developement

'Actiemonitor' online projectmanagement software