本文整理汇总了PHP中clladp::UserGetGroups方法的典型用法代码示例。如果您正苦于以下问题:PHP clladp::UserGetGroups方法的具体用法?PHP clladp::UserGetGroups怎么用?PHP clladp::UserGetGroups使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类clladp
的用法示例。
在下文中一共展示了clladp::UserGetGroups方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: GROUPS_LIST
function GROUPS_LIST($OU)
{
writelogs("startup ou={$OU}", __FUNCTION__, __FILE__);
$page = CurrentPageName();
$ou = $OU;
if (is_base64_encoded($ou)) {
$ou = base64_decode($ou);
}
writelogs("Encoded ou ? =\"{$ou}\" {$_SESSION["uid"]}", __FUNCTION__, __FILE__);
$ldap = new clladp();
$users = new usersMenus();
if ($users->AsArticaAdministrator) {
writelogs("AsArticaAdministrator privileges", __FUNCTION__, __FILE__);
$org = $ldap->hash_get_ou(true);
while (list($ou1, $ou2) = each($org)) {
$orgs_encoded[base64_encode($ou1)] = $ou2;
}
//$orgs=Field_array_Hash($orgs_encoded,'SelectOuList',base64_encode($ou),"LoadGroupList()",null,0,'width:250px');
$hash = $ldap->hash_groups($ou, 1);
writelogs("AsArticaAdministrator:: Load " . count($hash) . " groups from ou {$ou}", __FUNCTION__, __FILE__);
} else {
$ou = ORGANISTATION_FROM_USER();
//$orgs="<strong>$ou</strong><input type='hidden' name=SelectOuList id='SelectOuList' value='$ou'>";
if (!$users->AsOrgAdmin) {
$hash = $ldap->UserGetGroups($_SESSION["uid"], 1);
}
if ($users->AsOrgAdmin) {
$hash = $ldap->hash_groups($ou, 1);
}
}
if (is_array($hash)) {
while (list($num, $line) = each($hash)) {
if (strtolower($line) == 'default_group') {
unset($hash["{$num}"]);
}
$tr[] = $num;
}
}
$orgs = Field_hidden("SelectOuList", base64_encode($ou));
writelogs("Load " . count($hash) . " groups from ou {$ou}", __FUNCTION__, __FILE__);
$hash[null] = "{select_group}";
reset($hash);
$field = Field_array_Hash($hash, 'SelectGroupList', null, "LoadGroupSettings()", null, 0, 'width:250px');
$html = "\n\t{$orgs}\n\t<table style='width:300px'>\n\t<td width=80%>{$field}</td>\n\t<td width=1%>" . imgtootltip('20-refresh.png', '{refresh}', "RefreshGroupList()") . "</td>\n\t<td width=1%>" . button("{add}", "Loadjs('{$page}?popup-add-group=yes&ou={$ou}')") . "</td>\n\t</tr>\n\t</table>\n\t\n\t<script>\n\tfunction RefreshGroupList(){\n\t\t\tLoadAjax('grouplist','{$page}?LoadGroupList={$ou}')\n\t\t\n\t\t}\n\t\n\tLoadGroupSettings('{$tr[0]}');\t\n\t</script>\n\t\n\t\n\t";
$tpl = new templates();
return $tpl->_ENGINE_parse_body($html);
}
示例2: USER_DELETE_ALL_GROUPS
function USER_DELETE_ALL_GROUPS($userid)
{
$ldap = new clladp();
$hash = $ldap->UserGetGroups($userid);
writelogs("delete this user from " . count($hash) . " groups ", __FUNCTION__, __FILE__, __LINE__);
if (is_array($hash)) {
while (list($num, $ligne) = each($hash)) {
writelogs("delete user {$userid} from group number {$ligne}", __FUNCTION__, __FILE__, __LINE__);
if (!$ldap->UserDeleteToGroup($userid, $ligne)) {
echo $ldap->ldap_last_error;
exit;
}
}
}
}
示例3: checklogon
//.........这里部分代码省略.........
return;
}
return;
}
}
writelogs("{$username}::Finally Is LOCAL LDAP ? -> {$IsKerbAuth}", __FUNCTION__, __FILE__, __LINE__);
$u = new user($username);
$tpl = new templates();
$userPassword = $u->password;
if (trim($u->uidNumber) == null) {
writelogs('Unable to get user infos abort', __FUNCTION__, __FILE__);
if ($Aspost) {
MainPage("Unknown user (" . __LINE__ . ")");
return;
}
echo "Unknown user (" . __LINE__ . ")";
die;
}
writelogs("{$username}:: Password match ? Aspost = {$Aspost}", __FUNCTION__, __FILE__, __LINE__);
if ($Aspost) {
if (trim($password) != trim($userPassword)) {
writelogs("{$username}:: Password match NO Aspost = {$Aspost}", __FUNCTION__, __FILE__, __LINE__);
MainPage("Bad password (" . __LINE__ . ")");
return;
}
}
if (!$Aspost) {
if (trim($password) != md5(trim($userPassword))) {
writelogs("{$username}:: Password match NO Aspost = {$Aspost}", __FUNCTION__, __FILE__, __LINE__);
writelogs("[{$_POST["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 `{$username}` from {$_SERVER["REMOTE_HOST"]} (bad password)", @implode("\n", $notice), "security", "security");
if ($Aspost) {
MainPage("Bad password (" . __LINE__ . ")");
return;
}
echo "Error: (" . __LINE__ . ") bad password";
return null;
}
}
writelogs("{$username}:: Password match YES Aspost = {$Aspost}", __FUNCTION__, __FILE__, __LINE__);
$ldap = new clladp();
$users = new usersMenus();
$_SESSION["CORP"] = $users->CORP_LICENSE;
$privs = new privileges($u->uid);
$privs->SearchPrivileges();
$privileges_array = $privs->privs;
$_SESSION["VirtAclUser"] = false;
$_SESSION["privileges_array"] = $privs->privs;
$_SESSION["privs"] = $privileges_array;
if (isset($privileges_array["ForceLanguageUsers"])) {
$_SESSION["OU_LANG"] = $privileges_array["ForceLanguageUsers"];
}
$_SESSION["uid"] = $username;
$_SESSION["privileges"]["ArticaGroupPrivileges"] = $privs->content;
$_SESSION["groupid"] = $ldap->UserGetGroups($_POST["username"], 1);
$_SESSION["DotClearUserEnabled"] = $u->DotClearUserEnabled;
$_SESSION["MailboxActive"] = $u->MailboxActive;
$_SESSION["InterfaceType"] = "{APP_ARTICA_ADM}";
$_SESSION["ou"] = $u->ou;
$_SESSION["UsersInterfaceDatas"] = trim($u->UsersInterfaceDatas);
include_once dirname(__FILE__) . "/ressources/class.translate.rights.inc";
$cr = new TranslateRights(null, null);
$r = $cr->GetPrivsArray();
while (list($key, $val) = each($r)) {
if ($users->{$key}) {
$_SESSION[$key] = $users->{$key};
}
}
if (is_array($_SESSION["privs"])) {
$r = $_SESSION["privs"];
while (list($key, $val) = each($r)) {
$t[$key] = $val;
$_SESSION[$key] = $val;
}
}
if (!isset($_SESSION["OU_LANG"])) {
$_SESSION["OU_LANG"] = null;
}
if (!isset($_SESSION["ASDCHPAdmin"])) {
$_SESSION["ASDCHPAdmin"] = false;
}
if (trim($_SESSION["OU_LANG"]) != null) {
$_SESSION["detected_lang"] = $_SESSION["OU_LANG"];
} else {
include_once dirname(__FILE__) . "/ressources/class.langages.inc";
$lang = new articaLang();
$_SESSION["detected_lang"] = $lang->get_languages();
}
if (isset($GLOBALS["FixedLanguage"])) {
$sock = new sockets();
$GLOBALS["FixedLanguage"] = $sock->GET_INFO("FixedLanguage");
}
if (trim($GLOBALS["FixedLanguage"]) != null) {
$_SESSION["detected_lang"] = $GLOBALS["FixedLanguage"];
}
if ($Aspost) {
header("location:miniadm.index.php");
return;
}
}
示例4: 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;
}
}