本文整理汇总了PHP中usersMenus::IfIsAnuser方法的典型用法代码示例。如果您正苦于以下问题:PHP usersMenus::IfIsAnuser方法的具体用法?PHP usersMenus::IfIsAnuser怎么用?PHP usersMenus::IfIsAnuser使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类usersMenus
的用法示例。
在下文中一共展示了usersMenus::IfIsAnuser方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: folder_create
function folder_create()
{
$root = base64_decode($_POST["root"]);
$newFolder = $_POST["create-folder"];
$newpath = "{$root}/{$newFolder}";
$newpath = str_replace("//", "/", $newpath);
$newpath = strip_path_accents($newpath);
$newpath = utf8_encode($newpath);
$users = new usersMenus();
if ($users->IfIsAnuser()) {
$perms = "&perms=" . base64_encode($_SESSION["uid"]);
}
$tpl = new templates();
$sock = new sockets();
echo $tpl->javascript_parse_text(base64_decode($sock->getFrameWork("cmd.php?create-folder=" . base64_encode($newpath) . $perms)));
}
示例2: logon
function logon()
{
include "ressources/settings.inc";
$_POST["artica_password"] = url_decode_special($_POST["artica_password"]);
writelogs("Testing logon....{$_POST["artica_username"]}", __FUNCTION__, __FILE__, __LINE__);
writelogs("Testing logon.... password:{$_POST["artica_password"]}", __FUNCTION__, __FILE__, __LINE__);
$_COOKIE["artica-language"] = $_POST["lang"];
$socks = new sockets();
if (!$socks->TestArticaPort()) {
if (is_file("ressources/logs/boa.start")) {
$boa_error = file_get_contents("ressources/logs/boa.start");
}
echo "Unable to connect to Artica daemon port:{$boa_error}";
exit;
}
if ($_POST["artica_username"] == $_GLOBAL["ldap_admin"]) {
if ($_POST["artica_password"] != $_GLOBAL["ldap_password"]) {
echo "bad password";
return null;
} else {
//session_start();
$_SESSION["uid"] = '-100';
$_SESSION["groupid"] = '-100';
$_SESSION["passwd"] = $_POST["artica_password"];
setcookie("artica-language", $_POST["lang"], time() + 172800);
$_SESSION["detected_lang"] = $_POST["lang"];
$_SESSION["privileges"]["ArticaGroupPrivileges"] = '
[AllowAddGroup]="yes"
[AllowAddUsers]="yes"
[AllowChangeKav]="yes"
[AllowChangeKas]="yes"
[AllowChangeUserPassword]="yes"
[AllowEditAliases]="yes"
[AllowEditAsWbl]="yes"
[AsSystemAdministrator]="yes"
[AsPostfixAdministrator]="yes"
[AsArticaAdministrator]="yes"
';
$tpl = new templates();
echo "location:admin.index.php";
exit;
}
}
writelogs('This is not Global admin, so test user...', __FUNCTION__, __FILE__);
$u = new user($_POST["artica_username"]);
$userPassword = $u->password;
if (trim($u->uidNumber) == null) {
writelogs('Unable to get user infos abort', __FUNCTION__, __FILE__);
echo "Unknown user";
return null;
}
if (trim($_POST["artica_password"]) == trim($userPassword)) {
$ldap = new clladp();
$ouprivs = $ldap->_Get_privileges_ou($u->uid, $u->ou);
$privileges = $ldap->_Get_privileges_userid($_POST["artica_username"]);
$_SESSION["OU_LANG"] = $ouprivs["ForceLanguageUsers"];
$_SESSION["uid"] = $_POST["artica_username"];
$_SESSION["passwd"] = $_POST["artica_password"];
$_SESSION["privileges"]["ArticaGroupPrivileges"] = $privileges;
$_SESSION["groupid"] = $ldap->UserGetGroups($_POST["artica_username"], 1);
$_SESSION["DotClearUserEnabled"] = $u->DotClearUserEnabled;
$_SESSION["MailboxActive"] = $u->MailboxActive;
$_SESSION["ou"] = $u->ou;
$_SESSION["UsersInterfaceDatas"] = trim($u->UsersInterfaceDatas);
$lang = new articaLang();
writelogs("default organization language={$_SESSION["OU_LANG"]}", __FUNCTION__, __FILE__);
if (trim($_SESSION["OU_LANG"]) != null) {
$_SESSION["detected_lang"] = $_SESSION["OU_LANG"];
setcookie("artica-language", $_SESSION["OU_LANG"], time() + 172800);
} else {
setcookie("artica-language", $_POST["lang"], time() + 172800);
$_SESSION["detected_lang"] = $lang->get_languages();
}
$users = new usersMenus();
$privileges_array = $users->_ParsePrivieleges($privileges);
$users->_TranslateRights($privileges_array, true);
if (!$users->IfIsAnuser(true)) {
writelogs('This is not an user =>admin.index.php ', __FUNCTION__, __FILE__);
echo "location:admin.index.php";
return null;
}
writelogs('IT IS AN USER =>../user-backup/logon.php ', __FUNCTION__, __FILE__);
$tpl = new templates();
$array["USERNAME"] = $_POST["artica_username"];
$array["PASSWORD"] = md5($_POST["artica_username"]);
$credentials = base64_encode(serialize($array));
echo "location:../user-backup/logon.php?credentials={$credentials}";
return null;
exit;
} else {
writelogs("The passord typed is not the same in ldap database...", __FUNCTION__, __FILE__);
echo "bad password";
return null;
}
}
示例3: logon
//.........这里部分代码省略.........
setcookie("mem-logon-user", $_POST["artica_username"], time() + 172800);
$_SESSION["privileges_array"] = $privs->privs;
$_SESSION["uid"] = $_POST["artica_username"];
BuildSession($_POST["artica_username"]);
$sock->getFrameWork("squid.php?clean-catz-cache=yes");
$_SESSION["MINIADM"] = false;
setcookie("MINIADM", "No", time() + 1000);
if ($VIA_API) {
BuildSession($_SESSION["uid"]);
echo "TRUE";
return;
}
echo "location:admin.index.php";
return;
} else {
if (is_array($GLOBALS["CLASS_ACTV"])) {
while (list($key, $line) = each($GLOBALS["CLASS_ACTV"])) {
writelogs("*** Active Directory {$line}", __FUNCTION__, __FILE__, __LINE__);
}
}
}
}
if (Radius_admins($_POST["artica_username"], $md5submitted)) {
writelogs('*** TEST RADIUS USER ****', __FUNCTION__, __FILE__, __LINE__);
$tpl = new templates();
$sock->getFrameWork("squid.php?clean-catz-cache=yes");
writelogs("OK it is a global admin -> location:admin.index.php", _FUNCTION__, __FILE__, __LINE__);
if ($VIA_API) {
BuildSession($_SESSION["uid"]);
echo "TRUE";
return;
}
echo "location:admin.index.php";
exit;
}
writelogs('This is not Global admin, so test user...', __FUNCTION__, __FILE__, __LINE__);
$u = new user($_POST["artica_username"]);
$userPassword = $u->password;
if (trim($u->uidNumber) == null) {
if ($VIA_API) {
echo "FALSE";
return;
}
writelogs('Unable to get user infos abort', __FUNCTION__, __FILE__);
echo $tpl->javascript_parse_text("{wrong_password_or_username}");
return null;
}
$tpl = new templates();
if (trim($_POST["artica_password"]) == md5(trim($userPassword))) {
BuildSession($u->uid);
$ldap = new clladp();
$users = new usersMenus();
$privs = new privileges($u->uid);
$privileges_array = $privs->privs;
if (trim($FixedLanguage) != null) {
$_SESSION["detected_lang"] = $FixedLanguage;
}
$users->_TranslateRights($privileges_array, true);
if (!$users->IfIsAnuser(true)) {
if ($VIA_API) {
echo "TRUE";
return;
}
artica_mysql_events("Success to logon on the Artica Web console from {$_SERVER["REMOTE_HOST"]} as User", @implode("\n", $notice), "security", "security");
writelogs("[{$_POST["artica_username"]}]: This is not an user =>admin.index.php", __FUNCTION__, __FILE__);
$sock->getFrameWork("squid.php?clean-catz-cache=yes");
$_SESSION["MINIADM"] = false;
setcookie("MINIADM", "No", time() + 1000);
if ($VIA_API) {
BuildSession($_SESSION["uid"]);
echo "TRUE";
return;
}
echo "location:admin.index.php";
return null;
}
if ($VIA_API) {
BuildSession($_SESSION["uid"]);
echo "TRUE";
return;
}
writelogs("[{$_POST["artica_username"]}]: IS AN USER =>../user-backup/logon.php", __FUNCTION__, __FILE__);
$array["USERNAME"] = $_POST["artica_username"];
$array["PASSWORD"] = md5($_POST["artica_username"]);
$credentials = base64_encode(serialize($array));
artica_mysql_events("Success to redirect on the end-user management console from {$_SERVER["REMOTE_HOST"]} as User", @implode("\n", $notice), "security", "security");
echo "location:../miniadm.logon.php?credentials={$credentials}";
return null;
exit;
} else {
if ($VIA_API) {
echo "FALSE";
return;
}
writelogs("[{$_POST["artica_username"]}]: The password typed is not the same in ldap database...", __FUNCTION__, __FILE__);
artica_mysql_events("Failed to logon on the management console as user from {$_SERVER["REMOTE_HOST"]} (bad password)", @implode("\n", $notice), "security", "security");
echo $tpl->javascript_parse_text("{wrong_password_or_username}");
return null;
}
}