本文整理汇总了PHP中AJXP_XMLWriter::getUserXML方法的典型用法代码示例。如果您正苦于以下问题:PHP AJXP_XMLWriter::getUserXML方法的具体用法?PHP AJXP_XMLWriter::getUserXML怎么用?PHP AJXP_XMLWriter::getUserXML使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类AJXP_XMLWriter
的用法示例。
在下文中一共展示了AJXP_XMLWriter::getUserXML方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: wsAuthenticate
public function wsAuthenticate($action, $httpVars, $fileVars)
{
$this->logDebug("Entering wsAuthenticate");
$configs = $this->getConfigs();
if (!isset($httpVars["key"]) || $httpVars["key"] != $configs["WS_SERVER_ADMIN"]) {
throw new Exception("Cannot authentify admin key");
}
$user = AuthService::getLoggedUser();
if ($user == null) {
$this->logDebug("Error Authenticating through WebSocket (not logged)");
throw new Exception("You must be logged in");
}
$xml = AJXP_XMLWriter::getUserXML($user);
// add groupPath
if ($user->getGroupPath() != null) {
$groupString = "groupPath=\"" . AJXP_Utils::xmlEntities($user->getGroupPath()) . "\"";
$xml = str_replace("<user id=", "<user {$groupString} id=", $xml);
}
$this->logDebug("Authenticating user " . $user->id . " through WebSocket");
AJXP_XMLWriter::header();
echo $xml;
AJXP_XMLWriter::close();
}
示例2: sendUserData
function sendUserData($userObject = null, $details = false)
{
print AJXP_XMLWriter::getUserXML($userObject, $details);
}