XML writer class. More...
Public Member Functions | |
ilSoapUserObjectXMLWriter () | |
constructor | |
setAttachRoles ($value) | |
setObjects (&$users) | |
start () | |
getXML () | |
__buildHeader () | |
__buildFooter () | |
__handleUser ($row) | |
__addElement ($tagname, $value, $attrs=null, $settingsname=null) | |
Data Fields | |
$ilias | |
$xml | |
$users | |
$user_id = 0 | |
$attachRoles = false |
XML writer class.
Class to simplify manual writing of xml documents. It only supports writing xml sequentially, because the xml document is saved in a string with no additional structure information. The author is responsible for well-formedness and validity of the xml document.
Definition at line 41 of file class.ilSoapUserObjectXMLWriter.php.
ilSoapUserObjectXMLWriter::__addElement | ( | $ | tagname, | |
$ | value, | |||
$ | attrs = null , |
|||
$ | settingsname = null | |||
) |
Definition at line 221 of file class.ilSoapUserObjectXMLWriter.php.
References ilXmlWriter::xmlElement().
Referenced by __handleUser().
{ $this->xmlElement ($tagname, $attrs, $value); }
ilSoapUserObjectXMLWriter::__buildFooter | ( | ) |
Definition at line 114 of file class.ilSoapUserObjectXMLWriter.php.
References ilXmlWriter::xmlEndTag().
Referenced by start().
{ $this->xmlEndTag('Users'); }
ilSoapUserObjectXMLWriter::__buildHeader | ( | ) |
Definition at line 103 of file class.ilSoapUserObjectXMLWriter.php.
References ilXmlWriter::xmlHeader(), ilXmlWriter::xmlSetDtdDef(), ilXmlWriter::xmlSetGenCmt(), and ilXmlWriter::xmlStartTag().
Referenced by start().
{ $this->xmlSetDtdDef("<!DOCTYPE Users PUBLIC \"-//ILIAS//DTD UserImport//EN\" \"".ILIAS_HTTP_PATH."/xml/ilias_user_3_7.dtd\">"); $this->xmlSetGenCmt("User of ilias system"); $this->xmlHeader(); $this->xmlStartTag('Users'); return true; }
ilSoapUserObjectXMLWriter::__handleUser | ( | $ | row | ) |
never export passwords!
Definition at line 119 of file class.ilSoapUserObjectXMLWriter.php.
References $query, $row, $type, __addElement(), ilXmlWriter::xmlElement(), ilXmlWriter::xmlEndTag(), and ilXmlWriter::xmlStartTag().
Referenced by start().
{ global $ilDB; if (strlen($row["language"]) == 0) $row["language"] = "en"; $attrs = array ( 'Id' => "il_".IL_INST_ID."_usr_".$row["usr_id"], 'Language' => $row["language"], 'Action' => "Update"); $this->xmlStartTag("User", $attrs); $this->xmlElement("Login", null, $row["login"]); if ($this->attachRoles == TRUE) { include_once './classes/class.ilObjRole.php'; $query = sprintf("SELECT object_data.title, object_data.description, rbac_fa.* FROM object_data, rbac_ua, rbac_fa WHERE rbac_ua.usr_id = %s AND rbac_ua.rol_id = rbac_fa.rol_id AND object_data.obj_id = rbac_fa.rol_id", $ilDB->quote($row["usr_id"]) ); $rbacresult = $ilDB->query($query); while ($rbacrow = $rbacresult->fetchRow(DB_FETCHMODE_ASSOC)) { if ($rbacrow["assign"] != "y") continue; $type = ""; if ($rbacrow["parent"] == ROLE_FOLDER_ID) { $type = "Global"; } else { $type = "Local"; } if (strlen($type)) { $this->xmlElement("Role", array ("Id" => "il_".IL_INST_ID."_role_".$rbacrow["rol_id"], "Type" => $type), $rbacrow["title"]); } } } $this->__addElement ("Firstname", $row["firstname"]); $this->__addElement ("Lastname", $row["lastname"]); $this->__addElement ("Title", $row["title"]); $this->__addElement ("Gender", $row["gender"]); $this->__addElement ("Email", $row["email"]); $this->__addElement ("Institution", $row["institution"]); $this->__addElement ("Street", $row["street"]); $this->__addElement ("City", $row["city"]); $this->__addElement ("PostalCode", $row["zipcode"], null, "zipcode"); $this->__addElement ("Country", $row["country"]); $this->__addElement ("PhoneOffice", $row["phone_office"], null, "phone_office"); $this->__addElement ("PhoneHome", $row["phone_home"], null, "phone_home"); $this->__addElement ("PhoneMobile", $row["phone_mobile"], null, "phone_mobile"); $this->__addElement ("Fax", $row["fax"]); $this->__addElement ("Department", $row["department"]); $this->__addElement ("Comment", $row["referral_comment"], null, "referral_comment"); $this->__addElement ("Matriculation", $row["matriculation"]); $this->__addElement ("Active", $row["active"] ? "true":"false" ); $this->__addElement ("ClientIP", $row["client_ip"], null, "client_ip"); $this->__addElement ("TimeLimitOwner", $row["time_limit_owner"], null, "time_limit_owner"); $this->__addElement ("TimeLimitUnlimited", $row["time_limit_unlimited"], null, "time_limit_unlimited"); $this->__addElement ("TimeLimitFrom", $row["time_limit_from"], null, "time_limit_from"); $this->__addElement ("TimeLimitUntil", $row["time_limit_until"], null, "time_limit_until"); $this->__addElement ("TimeLimitMessage", $row["time_limit_message"], null, "time_limit_message"); $this->__addElement ("ApproveDate", $row["approve_date"], null, "client_ip"); $this->__addElement ("AgreeDate", $row["agree_date"], null, "agree_date"); if ((int) $row["ilinc_id"] !=0) { $this->__addElement ("iLincID", $row["ilinc_id"], "ilinc_id"); $this->__addElement ("iLincUser", $row["ilinc_user"], "ilinc_user"); $this->__addElement ("iLincPasswd", $row["ilinc_passwd"], "ilinc_passwd"); } if (strlen($row["auth_mode"])>0) { $this->__addElement ("AuthMode", null, array ("type" => $row["auth_mode"])); } include_once ("classes/class.ilUserDefinedData.php"); $udf_data = new ilUserDefinedData($row['usr_id']); $udf_data->addToXML($this); $this->xmlEndTag('User'); }
ilSoapUserObjectXMLWriter::getXML | ( | ) |
Definition at line 97 of file class.ilSoapUserObjectXMLWriter.php.
References ilXmlWriter::xmlDumpMem().
{ return $this->xmlDumpMem(FALSE); }
ilSoapUserObjectXMLWriter::ilSoapUserObjectXMLWriter | ( | ) |
constructor
string | xml version | |
string | output encoding | |
string | input encoding public |
Definition at line 56 of file class.ilSoapUserObjectXMLWriter.php.
References $ilias, and ilXmlWriter::ilXmlWriter().
{ global $ilias,$ilUser; parent::ilXmlWriter(); $this->ilias =& $ilias; $this->user_id = $ilUser->getId(); $this->attachRoles = false; }
ilSoapUserObjectXMLWriter::setAttachRoles | ( | $ | value | ) |
Definition at line 67 of file class.ilSoapUserObjectXMLWriter.php.
{ $this->attachRoles = $value == 1? true : false; }
ilSoapUserObjectXMLWriter::setObjects | ( | &$ | users | ) |
Definition at line 72 of file class.ilSoapUserObjectXMLWriter.php.
References $users.
{ $this->users = & $users; }
ilSoapUserObjectXMLWriter::start | ( | ) |
Definition at line 78 of file class.ilSoapUserObjectXMLWriter.php.
References $user, __buildFooter(), __buildHeader(), and __handleUser().
{ if (!is_array($this->users)) return false; $this->__buildHeader(); foreach ($this->users as $user) { $this->__handleUser ($user); } $this->__buildFooter(); return true; }
ilSoapUserObjectXMLWriter::$attachRoles = false |
Definition at line 47 of file class.ilSoapUserObjectXMLWriter.php.
ilSoapUserObjectXMLWriter::$ilias |
Definition at line 43 of file class.ilSoapUserObjectXMLWriter.php.
Referenced by ilSoapUserObjectXMLWriter().
ilSoapUserObjectXMLWriter::$user_id = 0 |
Definition at line 46 of file class.ilSoapUserObjectXMLWriter.php.
ilSoapUserObjectXMLWriter::$users |
Definition at line 45 of file class.ilSoapUserObjectXMLWriter.php.
Referenced by setObjects().
ilSoapUserObjectXMLWriter::$xml |
Definition at line 44 of file class.ilSoapUserObjectXMLWriter.php.