20 include_once (
'WHAT/Class.Authenticator.php');
25 private $privatelogin =
false;
31 include_once (
'WHAT/Lib.Http.php');
33 $privatekey = getHttpVars(
"privateid");
37 if ($this->privatelogin ===
false) {
51 include_once (
'WHAT/Class.UserToken.php');
52 include_once (
'WHAT/Class.User.php');
55 if (!is_object($token) || !$token->isAffected()) {
56 error_log(__CLASS__ .
"::" . __FUNCTION__ .
" " . sprintf(
"Token '%s' not found.", $privatekey));
60 $uid = $token->userid;
62 if (!is_object(
$user) || !
$user->isAffected()) {
63 error_log(__CLASS__ .
"::" . __FUNCTION__ .
" " . sprintf(
"Could not get user with uid '%s' for token '%s'.",
$uid, $privatekey));
72 include_once (
'WHAT/Class.UserToken.php');
75 if (!is_object($token) || !$token->isAffected()) {
76 error_log(__CLASS__ .
"::" . __FUNCTION__ .
" " . sprintf(
"Token '%s' not found.", $privatekey));
80 $this->token = $token->getValues();
81 if ($token->expendable ===
't') {
102 return $this->privatelogin;
116 header(
"HTTP/1.0 401 Authorization Required ");
117 print _(
"private key is not valid");
127 include_once (
'WHAT/Class.Session.php');
128 $session_auth =
new Session($this->parms{
'cookie'});
129 if (array_key_exists($this->parms{
'cookie'}, $_COOKIE)) {
130 $session_auth->
Set($_COOKIE[$this->parms{
'cookie'}]);
132 $session_auth->Set();
137 return $session_auth->read(
$name);
146 include_once (
'WHAT/Class.Session.php');
147 $session_auth =
new Session($this->parms{
'cookie'});
148 if (array_key_exists($this->parms{
'cookie'}, $_COOKIE)) {
149 $session_auth->
Set($_COOKIE[$this->parms{
'cookie'}]);
151 $session_auth->Set();
154 return $session_auth->read(
$name);