ILIAS
eassessment Revision 61809
◀ ilDoc Overview
Main Page
Related Pages
Modules
Namespaces
Data Structures
Files
Examples
File List
Globals
ILIAS
Todo List
Deprecated List
Modules
Namespaces
Data Structures
Files
File List
classes
cron
include
Modules
Services
AccessControl
Accessibility
Accordion
Administration
AdvancedEditing
AdvancedMetaData
AuthApache
Authentication
AuthShibboleth
Block
Booking
Cache
Calendar
CAS
Certificate
Clipboard
Component
Contact
Container
ContainerReference
COPage
CopyWizard
Database
DataSet
Dom
EventHandling
Excel
Exceptions
Export
Feedback
Feeds
FileSystemStorage
Form
Frameset
GoogleMaps
Help
Html
InfoScreen
Init
InsertChar
JSON
Language
LDAP
License
LinkChecker
LoadTest
Locator
Logging
Mail
MainMenu
Math
MediaObjects
Membership
MetaData
Migration
Navigation
News
Notes
Notification
Object
OpenId
OrgUnit
Payment
PDF
PEAR
lib
Auth
Container
Array.php
DB.php
DBLite.php
File.php
IMAP.php
KADM5.php
LDAP.php
MDB.php
MDB2.php
Multiple.php
NetVPOPMaild.php
PEAR.php
POP3.php
RADIUS.php
SAP.php
SMBPasswd.php
SOAP.php
SOAP5.php
vpopmail.php
Frontend
Anonymous.php
Auth.php
Container.php
Controller.php
HTTP.php
RADIUS.php
HTML
HTTP
Log
Mail
MDB2
Net
OLE
PEAR
Spreadsheet
XML
Auth.php
Log.php
Mail.php
MDB2.php
PEAR.php
ReleasesInfo.php
System.php
PermanentLink
PersonalDesktop
PHPUnit
PrivacySecurity
QTI
Radius
Rating
Registration
Repository
RTE
Search
SOAPAuth
Style
Survey
Table
Tagging
Tracking
Transformation
Tree
UIComponent
User
Utilities
WebAccessChecker
WebDAV
WebServices
Workflow
XHTMLPage
XHTMLValidator
Xml
YUI
setup
sso
webservice
calendar.php
confirmReg.php
error.php
feed.php
goto.php
ilias.php
index.php
login.php
logout.php
payment.php
privfeed.php
pwassist.php
register.php
repository.php
rootindex.php
sessioncheck.php
shib_login.php
shib_logout.php
start.php
studip_referrer.php
webdav.php
Globals
Examples
•
All
Data Structures
Namespaces
Files
Functions
Variables
Groups
Pages
PEAR.php
Go to the documentation of this file.
1
<?php
2
/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4 foldmethod=marker: */
3
29
require_once
'HTTP/Client.php'
;
33
require_once
'Auth/Container.php'
;
34
57
class
Auth_Container_Pear
extends
Auth_Container
58
{
59
// {{{ properties
60
66
var
$url
=
'https://pear.php.net/rest-login.php/'
;
67
75
var
$karma
= array();
76
77
// }}}
78
// {{{ Auth_Container_Pear() [constructor]
79
89
function
Auth_Container_Pear
(
$data
= null)
90
{
91
if
(!is_array(
$data
)) {
92
PEAR::raiseError
(
'The options for Auth_Container_Pear must be an array'
);
93
}
94
if
(isset(
$data
[
'karma'
])) {
95
if
(is_array(
$data
[
'karma'
])) {
96
$this->karma =
$data
[
'karma'
];
97
}
else
{
98
$this->karma = array(
$data
[
'karma'
]);
99
}
100
}
101
102
if
(isset(
$data
[
'url'
])) {
103
$this->url =
$data
[
'url'
];
104
}
105
}
106
107
// }}}
108
// {{{ fetchData()
109
120
function
fetchData
($username, $password)
121
{
122
$this->
log
(
'Auth_Container_PEAR::fetchData() called.'
,
AUTH_LOG_DEBUG
);
123
124
$client
=
new
HTTP_Client;
125
126
$this->
log
(
'Auth_Container_PEAR::fetchData() getting salt.'
,
AUTH_LOG_DEBUG
);
127
$code =
$client
->get($this->url .
'/getsalt'
);
128
if
($code != 200) {
129
return
PEAR::raiseError
(
'Bad response to salt request.'
, $code);
130
}
131
$resp =
$client
->currentResponse();
132
$salt = $resp[
'body'
];
133
134
$this->
log
(
'Auth_Container_PEAR::fetchData() calling validate.'
,
AUTH_LOG_DEBUG
);
135
$postOptions = array(
136
'username'
=> $username,
137
'password'
=> md5($salt . md5($password))
138
);
139
if
(is_array($this->karma) && count($this->karma) > 0) {
140
$postOptions[
'karma'
] = implode(
','
, $this->karma);
141
}
142
143
$code =
$client
->post($this->url .
'/validate'
, $postOptions);
144
if
($code != 200) {
145
return
PEAR::raiseError
(
'Bad response to validate request.'
, $code);
146
}
147
$resp =
$client
->currentResponse();
148
149
list($code, $message) = explode(
' '
, $resp[
'body'
], 1);
150
if
($code != 8) {
151
return
PEAR::raiseError
($message, $code);
152
}
153
return
true
;
154
}
155
156
// }}}
157
158
}
159
?>
Services
PEAR
lib
Auth
Container
PEAR.php
Generated on Mon Apr 25 2016 19:01:39 for ILIAS by
1.8.1.2 (using
Doxyfile
)