ILIAS  Release_3_10_x_branch Revision 61812
 All Data Structures Namespaces Files Functions Variables Groups Pages
ilSoapAdministration Class Reference
+ Inheritance diagram for ilSoapAdministration:
+ Collaboration diagram for ilSoapAdministration:

Public Member Functions

 ilSoapAdministration ($use_nusoap=true)
 __checkSession ($sid)
 initErrorWriter ()
 Overwrite error handler.
 __explodeSid ($sid)
 __setMessage ($a_str)
 __getMessage ()
 __appendMessage ($a_str)
 __initAuthenticationObject ($a_auth_mode=AUTH_LOCAL)
 __raiseError ($a_message, $a_code)
 getNIC ($sid)
 get client information from current as xml result set
 isFault ($object)
 checkObjectAccess ($ref_id, $expected_type, $permission, $returnObject=false)
 check access for ref id: expected type, permission, return object instance if returnobject is true
 getInstallationInfoXML ()
 getClientInfoXML ($clientid)

Static Public Member Functions

static return_bytes ($val)
 calculate bytes from K,M,G modifiers e.g: 8M = 8 * 1024 * 1024 bytes

Data Fields

 $sauth = null
 $error_method = null

Private Member Functions

 getClientInfo ($init, $client_dir)

Detailed Description

Definition at line 41 of file class.ilSoapAdministration.php.

Member Function Documentation

ilSoapAdministration::__appendMessage (   $a_str)

Definition at line 121 of file class.ilSoapAdministration.php.

Referenced by ilSoapUserAdministration\__validateUserData().

{
$this->message .= isset($this->message) ? ' ' : '';
$this->message .= $a_str;
}

+ Here is the caller graph for this function:

ilSoapAdministration::__checkSession (   $sid)

Definition at line 76 of file class.ilSoapAdministration.php.

References $client, and __explodeSid().

Referenced by ilSoapCourseAdministration\addCourse(), ilSoapExerciseAdministration\addExercise(), ilSoapFileAdministration\addFile(), ilSoapGroupAdministration\addGroup(), ilSoapObjectAdministration\addObject(), ilSoapObjectAdministration\addReference(), ilSoapRBACAdministration\addRole(), ilSoapRBACAdministration\addRoleFromTemplate(), ilSoapUserAdministration\addUser(), ilSoapRBACAdministration\addUserRoleEntry(), ilSoapCourseAdministration\assignCourseMember(), ilSoapGroupAdministration\assignGroupMember(), ilSoapObjectAdministration\copyObject(), ilSoapCourseAdministration\deleteCourse(), ilSoapObjectAdministration\deleteObject(), ilSoapRBACAdministration\deleteRole(), ilSoapUserAdministration\deleteUser(), ilSoapRBACAdministration\deleteUserRoleEntry(), ilSoapCourseAdministration\excludeCourseMember(), ilSoapGroupAdministration\excludeGroupMember(), ilSoapCourseAdministration\getCoursesForUser(), ilSoapCourseAdministration\getCourseXML(), ilSoapExerciseAdministration\getExerciseXML(), ilSoapFileAdministration\getFileXML(), ilSoapGroupAdministration\getGroup(), ilSoapGroupAdministration\getGroupsForUser(), ilSoapSCORMAdministration\getIMSManifestXML(), ilSoapRBACAdministration\getLocalRoles(), ilSoapUtils\getMobsOfObject(), getNIC(), ilSoapObjectAdministration\getObjectByReference(), ilSoapObjectAdministration\getObjectsByTitle(), ilSoapRBACAdministration\getObjectTreeOperations(), ilSoapObjectAdministration\getObjIdByImportId(), ilSoapObjectAdministration\getObjIdsByRefIds(), ilSoapRBACAdministration\getOperations(), ilSoapObjectAdministration\getPathForRefId(), ilSoapTestAdministration\getQuestionSolution(), ilSoapObjectAdministration\getRefIdsByImportId(), ilSoapObjectAdministration\getRefIdsByObjId(), ilSoapRBACAdministration\getRoles(), ilSOAPStructureObjectAdministration\getStructureObjects(), ilSoapTestAdministration\getTestResults(), ilSoapObjectAdministration\getTreeChilds(), ilSoapUserAdministration\getUser(), ilSoapUserAdministration\getUserForRole(), ilSoapRBACAdministration\getUserRoles(), ilSoapUserAdministration\getUsersForContainer(), ilSoapUserAdministration\getUserXML(), ilSoapObjectAdministration\getXMLTree(), ilSoapRBACAdministration\grantPermissions(), ilSoapGroupAdministration\groupExists(), ilSoapUtils\handleECSTasks(), ilSoapUserAdministration\hasNewMail(), ilSoapUtils\ilClone(), ilSoapUtils\ilCloneDependencies(), ilSoapUserAdministration\importUsers(), ilSoapCourseAdministration\isAssignedToCourse(), ilSoapGroupAdministration\isAssignedToGroup(), ilSoapUserAdministration\logout(), ilSoapUserAdministration\lookupUser(), ilSoapObjectAdministration\moveObject(), ilSoapObjectAdministration\removeFromSystemByImportId(), ilSoapRBACAdministration\revokePermissions(), ilSoapTestAdministration\saveQuestion(), ilSoapTestAdministration\saveQuestionResult(), ilSoapUtils\saveTempFileAsMediaObject(), ilSoapObjectAdministration\searchObjects(), ilSoapRBACAdministration\searchRoles(), ilSoapUserAdministration\searchUser(), ilSoapUtils\sendMail(), ilSoapCourseAdministration\updateCourse(), ilSoapExerciseAdministration\updateExercise(), ilSoapFileAdministration\updateFile(), ilSoapGroupAdministration\updateGroup(), ilSoapObjectAdministration\updateObjects(), ilSoapUserAdministration\updatePassword(), and ilSoapUserAdministration\updateUser().

{
//return true;
list($sid,$client) = $this->__explodeSid($sid);
$this->sauth->setClient($client);
$this->sauth->setSid($sid);
if(!$this->sauth->validateSession())
{
return false;
}
return true;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilSoapAdministration::__explodeSid (   $sid)

Definition at line 105 of file class.ilSoapAdministration.php.

Referenced by __checkSession().

{
$exploded = explode('::',$sid);
return is_array($exploded) ? $exploded : array('sid' => '','client' => '');
}

+ Here is the caller graph for this function:

ilSoapAdministration::__getMessage ( )

Definition at line 117 of file class.ilSoapAdministration.php.

Referenced by ilSoapUserAdministration\__validateUserData(), ilSoapUserAdministration\addUser(), and ilSoapUserAdministration\updateUser().

{
return $this->message;
}

+ Here is the caller graph for this function:

ilSoapAdministration::__initAuthenticationObject (   $a_auth_mode = AUTH_LOCAL)

Definition at line 128 of file class.ilSoapAdministration.php.

References AUTH_CAS, and AUTH_LDAP.

Referenced by ilSoapAdministration(), ilSoapUserAdministration\login(), ilSoapUserAdministration\loginCAS(), and ilSoapUserAdministration\loginLDAP().

{
switch($a_auth_mode)
{
case AUTH_CAS:
include_once './webservice/soap/classes/class.ilSoapAuthenticationCAS.php';
return $this->sauth = new ilSoapAuthenticationCAS();
case AUTH_LDAP:
include_once './webservice/soap/classes/class.ilSoapAuthenticationLDAP.php';
return $this->sauth = new ilSoapAuthenticationLDAP();
default:
include_once './webservice/soap/classes/class.ilSoapAuthentication.php';
return $this->sauth = new ilSoapAuthentication();
}
}

+ Here is the caller graph for this function:

ilSoapAdministration::__raiseError (   $a_message,
  $a_code 
)

Definition at line 146 of file class.ilSoapAdministration.php.

Referenced by ilSoapUserAdministration\__getImportProtocolAsXML(), ilSoapUserAdministration\__getUserMappingAsXML(), ilSoapCourseAdministration\addCourse(), ilSoapExerciseAdministration\addExercise(), ilSoapFileAdministration\addFile(), ilSoapGroupAdministration\addGroup(), ilSoapObjectAdministration\addObject(), ilSoapObjectAdministration\addReference(), ilSoapRBACAdministration\addRole(), ilSoapRBACAdministration\addRoleFromTemplate(), ilSoapUserAdministration\addUser(), ilSoapRBACAdministration\addUserRoleEntry(), ilSoapCourseAdministration\assignCourseMember(), ilSoapGroupAdministration\assignGroupMember(), ilSoapObjectAdministration\canAddType(), checkObjectAccess(), ilSoapObjectAdministration\copyObject(), ilSoapCourseAdministration\deleteCourse(), ilSoapObjectAdministration\deleteObject(), ilSoapRBACAdministration\deleteRole(), ilSoapUserAdministration\deleteUser(), ilSoapRBACAdministration\deleteUserRoleEntry(), ilSoapCourseAdministration\excludeCourseMember(), ilSoapGroupAdministration\excludeGroupMember(), getClientInfoXML(), ilSoapCourseAdministration\getCoursesForUser(), ilSoapCourseAdministration\getCourseXML(), ilSoapExerciseAdministration\getExerciseXML(), ilSoapFileAdministration\getFileXML(), ilSoapGroupAdministration\getGroup(), ilSoapGroupAdministration\getGroupsForUser(), ilSoapSCORMAdministration\getIMSManifestXML(), ilSoapRBACAdministration\getLocalRoles(), ilSoapUtils\getMobsOfObject(), getNIC(), ilSoapObjectAdministration\getObjectByReference(), ilSoapObjectAdministration\getObjectsByTitle(), ilSoapRBACAdministration\getObjectTreeOperations(), ilSoapObjectAdministration\getObjIdByImportId(), ilSoapObjectAdministration\getObjIdsByRefIds(), ilSoapRBACAdministration\getOperations(), ilSoapObjectAdministration\getPathForRefId(), ilSoapTestAdministration\getQuestionSolution(), ilSoapObjectAdministration\getRefIdsByImportId(), ilSoapObjectAdministration\getRefIdsByObjId(), ilSoapRBACAdministration\getRoles(), ilSOAPStructureObjectAdministration\getStructureObjects(), ilSoapTestAdministration\getTestResults(), ilSoapObjectAdministration\getTreeChilds(), ilSoapUserAdministration\getUser(), ilSoapUserAdministration\getUserForRole(), ilSoapRBACAdministration\getUserRoles(), ilSoapUserAdministration\getUsersForContainer(), ilSoapUserAdministration\getUserXML(), ilSoapObjectAdministration\getXMLTree(), ilSoapRBACAdministration\grantPermissions(), ilSoapGroupAdministration\groupExists(), ilSoapUtils\handleECSTasks(), ilSoapUserAdministration\hasNewMail(), ilSoapUtils\ilClone(), ilSoapUtils\ilCloneDependencies(), ilSoapUserAdministration\importUsers(), ilSoapCourseAdministration\isAssignedToCourse(), ilSoapGroupAdministration\isAssignedToGroup(), ilSoapUserAdministration\login(), ilSoapUserAdministration\loginCAS(), ilSoapUserAdministration\loginLDAP(), ilSoapUserAdministration\logout(), ilSoapUserAdministration\lookupUser(), ilSoapObjectAdministration\moveObject(), ilSoapRBACAdministration\parseUserID(), ilSoapObjectAdministration\removeFromSystemByImportId(), ilSoapRBACAdministration\revokePermissions(), ilSoapTestAdministration\saveQuestion(), ilSoapTestAdministration\saveQuestionResult(), ilSoapUtils\saveTempFileAsMediaObject(), ilSoapObjectAdministration\searchObjects(), ilSoapRBACAdministration\searchRoles(), ilSoapUserAdministration\searchUser(), ilSoapUtils\sendMail(), ilSoapCourseAdministration\updateCourse(), ilSoapExerciseAdministration\updateExercise(), ilSoapFileAdministration\updateFile(), ilSoapGroupAdministration\updateGroup(), ilSoapObjectAdministration\updateObjects(), ilSoapUserAdministration\updatePassword(), and ilSoapUserAdministration\updateUser().

{
#echo $a_message, $a_code;
switch($this->error_method)
{
case NUSOAP:
return new soap_fault($a_code,'',$a_message);
case PHP5:
return new SoapFault($a_code, $a_message);
}
}

+ Here is the caller graph for this function:

ilSoapAdministration::__setMessage (   $a_str)

Definition at line 113 of file class.ilSoapAdministration.php.

Referenced by ilSoapUserAdministration\__validateUserData().

{
$this->message = $a_str;
}

+ Here is the caller graph for this function:

ilSoapAdministration::checkObjectAccess (   $ref_id,
  $expected_type,
  $permission,
  $returnObject = false 
)

check access for ref id: expected type, permission, return object instance if returnobject is true

Parameters
int$ref_id
stringor array $expected_type
string$permission
boolean$returnObject
Returns
Object or type

Definition at line 277 of file class.ilSoapAdministration.php.

References $ref_id, __raiseError(), ilObject\_exists(), ilObject\_isInTrash(), ilObjectFactory\getInstanceByRefId(), and ilObjectFactory\getTypeByRefId().

Referenced by ilSoapCourseAdministration\getCoursesForUser(), ilSoapCourseAdministration\getCourseXML(), ilSoapGroupAdministration\getGroupsForUser(), and ilSoapUserAdministration\getUsersForContainer().

{
global $rbacsystem;
if(!is_numeric($ref_id))
{
return $this->__raiseError('No valid id given.',
'Client');
}
if (!ilObject::_exists($ref_id, true)) {
return $this->__raiseError('No object for id.',
'CLIENT_OBJECT_NOT_FOUND');
}
return $this->__raiseError('Object is already trashed.',
'CLIENT_OBJECT_DELETED');
}
if ((is_array($expected_type) && !in_array($type, $expected_type))
||
(!is_array($expected_type) && $type != $expected_type)
)
{
return $this->__raiseError("Wrong type $type for id. Expected: ".(is_array($expected_type) ? join (",",$expected_type) : $expected_type), 'CLIENT_OBJECT_WRONG_TYPE');
}
if (!$rbacsystem->checkAccess($permission, $ref_id, $type))
{
return $this->__raiseError('Missing permission $permission for type $type.', 'CLIENT_OBJECT_WRONG_PERMISSION');
}
if ($returnObject) {
}
return $type;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilSoapAdministration::getClientInfo (   $init,
  $client_dir 
)
private

Definition at line 376 of file class.ilSoapAdministration.php.

References $client_id, and $GLOBALS.

Referenced by getClientInfoXML(), and getInstallationInfoXML().

{
global $ilDB;
$ini_file = "./".$client_dir."/client.ini.php";
// get settings from ini file
require_once("classes/class.ilIniFile.php");
$ilClientIniFile = new ilIniFile($ini_file);
$ilClientIniFile->read();
if ($ilClientIniFile->ERROR != "")
{
return false;
}
$client_id = $ilClientIniFile->readVariable('client','name');
if ($ilClientIniFile->variableExists('client', 'expose'))
{
$client_expose = $ilClientIniFile->readVariable('client','expose');
if ($client_expose == "0")
return false;
}
// build dsn of database connection and connect
$dsn = $ilClientIniFile->readVariable("db","type")."://".$ilClientIniFile->readVariable("db", "user").
":".$ilClientIniFile->readVariable("db", "pass").
"@".$ilClientIniFile->readVariable("db", "host").
"/".$ilClientIniFile->readVariable("db", "name");
require_once "classes/class.ilDBx.php";
$ilDB = new ilDBx($dsn);
$GLOBALS['ilDB'] = $ilDB;
require_once("Services/Administration/classes/class.ilSetting.php");
$settings = new ilSetting();
$GLOBALS["ilSetting"] = $settings;
// workaround to determine http path of client
define ("IL_INST_ID", $settings->get("inst_id",0));
$settings->access = $ilClientIniFile->readVariable("client", "access");
$settings->description = $ilClientIniFile->readVariable("client","description");
$settings->session = min((int) ini_get("session.gc_maxlifetime"), (int) $ilClientIniFile->readVariable("session","expire"));
$settings->language = $ilClientIniFile->readVariable("language","default");
$settings->clientid = basename($client_dir); //pathinfo($client_dir, PATHINFO_FILENAME);
$settings->default_show_users_online = $settings->get("show_users_online");
$settings->default_hits_per_page = $settings->get("hits_per_page");
$skin = $ilClientIniFile->readVariable("layout","skin");
$style = $ilClientIniFile->readVariable("layout","style");
$settings->default_skin_style = $skin.":".$style;
return $settings;
}

+ Here is the caller graph for this function:

ilSoapAdministration::getClientInfoXML (   $clientid)

Definition at line 347 of file class.ilSoapAdministration.php.

References $client, $GLOBALS, __raiseError(), getClientInfo(), and ILIAS_WEB_DIR.

{
require_once("Services/Init/classes/class.ilInitialisation.php");
$init = new ilInitialisation();
$init->requireCommonIncludes();
$init->initIliasIniFile();
$ilias = & new ILIAS();
$GLOBALS['ilias'] =& $ilias;
$settings = array();
$clientdir = ILIAS_WEB_DIR."/".$clientid;
require_once ("webservice/soap/classes/class.ilSoapInstallationInfoXMLWriter.php");
$writer->setExportAdvancedMetaDataDefinitions (true);
$writer->setExportUDFDefinitions (true);
$writer->start();
if (is_object($client = $this->getClientInfo($init, $clientdir)))
{
$writer->addClient($client);
}
else
return $this->__raiseError("Client ID $clientid does not exist!", 'Client');
$writer->end();
return $writer->getXML();
}

+ Here is the call graph for this function:

ilSoapAdministration::getInstallationInfoXML ( )

Definition at line 315 of file class.ilSoapAdministration.php.

References $GLOBALS, getClientInfo(), and ILIAS_WEB_DIR.

{
require_once("Services/Init/classes/class.ilInitialisation.php");
$init = new ilInitialisation();
$init->requireCommonIncludes();
$init->initIliasIniFile();
$ilias = & new ILIAS();
$GLOBALS['ilias'] =& $ilias;
$settings = array();
$clientdirs = glob(ILIAS_WEB_DIR."/*",GLOB_ONLYDIR);
require_once ("webservice/soap/classes/class.ilSoapInstallationInfoXMLWriter.php");
$writer->start();
if (is_array($clientdirs))
{
foreach ($clientdirs as $clientdir)
{
if (is_object($clientInfo= $this->getClientInfo($init, $clientdir)))
{
$writer->addClient ($clientInfo);
}
}
}
$writer->end();
return $writer->getXML();
}

+ Here is the call graph for this function:

ilSoapAdministration::getNIC (   $sid)

get client information from current as xml result set

Parameters
string$sidcurrent session id
Returns
XMLResultSet containing columns installation_id, installation_version, installation_url, installation_description, installation_default_language

Definition at line 165 of file class.ilSoapAdministration.php.

References $ilLog, $ilSetting, __checkSession(), __raiseError(), ilAdvancedMDRecord\_getActivatedRecordsByObjectType(), ilAuthUtils\_getActiveAuthModes(), ilAdvancedMDRecord\_getAssignableObjectTypes(), ilAuthUtils\_getAuthModeName(), ILIAS_VERSION, and return_bytes().

{
if(!$this->__checkSession($sid))
{
return $this->__raiseError($this->sauth->getMessage(),$this->sauth->getMessageCode());
}
// Include main header
include_once './include/inc.header.php';
global $rbacsystem, $rbacreview, $ilLog, $rbacadmin,$ilSetting, $ilClientIniFile;
if (!is_object($ilClientIniFile)) {
return $this->__raiseError("Client ini is not initialized","Server");
}
$auth_mode_default = strtoupper(ilAuthUtils::_getAuthModeName(array_shift($auth_modes)));
$auth_mode_names = array();
foreach ($auth_modes as $mode) {
$auth_mode_names[] = strtoupper(ilAuthUtils::_getAuthModeName($mode));
}
include_once 'Services/AdvancedMetaData/classes/class.ilAdvancedMDRecord.php';
include_once 'Services/AdvancedMetaData/classes/class.ilAdvancedMDRecordXMLWriter.php';
// create advanced meta data record xml
$record_ids = array();
foreach($record_types as $type) {
foreach ($records as $record){
$record_ids [] = $record->getRecordId();
}
}
$record_ids = array_unique($record_ids);
$advmwriter = new ilAdvancedMDRecordXMLWriter($record_ids);
$advmwriter->write();
// create user defined fields record xml, simulate empty user records
include_once ("./Services/User/classes/class.ilUserXMLWriter.php");
$udfWriter = new ilUserXMLWriter();
$users = array();
$udfWriter->setObjects($users);
$udfWriter->start();
// todo: get information from client id, read from ini file specificied
$client_details[] = array ("installation_id" => IL_INST_ID,
"installation_version" => ILIAS_VERSION,
"installation_url" => ILIAS_HTTP_PATH,
"installation_description" => $ilClientIniFile->readVariable("client","description"),
"installation_language_default" => $ilClientIniFile->readVariable("language","default"),
"installation_session_expire" => $ilClientIniFile->readVariable("session","expire"),
"installation_php_postmaxsize" => $this->return_bytes(ini_get("post_max_size")),
"authentication_methods" => join(",", $auth_mode_names),
"authentication_default_method" => $auth_mode_default,
"installation_udf_xml" => $udfWriter ->getXML(),
"installation_advmd_xml" => $advmwriter->xmlDumpMem(false)
);
// store into xml result set
include_once './webservice/soap/classes/class.ilXMLResultSet.php';
$xmlResult = new ilXMLResultSet();
$xmlResult->addArray($client_details, true);
// create writer and return xml
include_once './webservice/soap/classes/class.ilXMLResultSetWriter.php';
$xmlResultWriter = new ilXMLResultSetWriter($xmlResult);
$xmlResultWriter->start();
return $xmlResultWriter->getXML();
}

+ Here is the call graph for this function:

ilSoapAdministration::ilSoapAdministration (   $use_nusoap = true)
ilSoapAdministration::initErrorWriter ( )

Overwrite error handler.

public

Parameters

Definition at line 97 of file class.ilSoapAdministration.php.

{
include_once('classes/class.ilErrorHandling.php');
set_error_handler(array('ilErrorHandling','_ilErrorWriter'),E_ALL);
}
ilSoapAdministration::isFault (   $object)

Definition at line 257 of file class.ilSoapAdministration.php.

Referenced by ilSoapObjectAdministration\copyObject(), ilSoapCourseAdministration\getCourseXML(), ilSoapUserAdministration\getUsersForContainer(), and ilSoapObjectAdministration\moveObject().

{
switch($this->error_method)
{
case NUSOAP:
return $object instanceof soap_fault;
case PHP5:
return $object instanceof SoapFault;
}
return true;
}

+ Here is the caller graph for this function:

static ilSoapAdministration::return_bytes (   $val)
static

calculate bytes from K,M,G modifiers e.g: 8M = 8 * 1024 * 1024 bytes

Definition at line 242 of file class.ilSoapAdministration.php.

Referenced by ilSoapInstallationInfoXMLWriter\__buildInstallationInfo(), and getNIC().

{
$val = trim($val);
$last = strtolower($val{strlen($val)-1});
switch($last) {
// The 'G' modifier is available since PHP 5.1.0
case 'g':
$val *= 1024;
case 'm':
$val *= 1024;
case 'k':
$val *= 1024;
}
return $val;
}

+ Here is the caller graph for this function:

Field Documentation

ilSoapAdministration::$error_method = null

Definition at line 53 of file class.ilSoapAdministration.php.

ilSoapAdministration::$sauth = null

Definition at line 47 of file class.ilSoapAdministration.php.


The documentation for this class was generated from the following file: