• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

PHP get_roles函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中get_roles函数的典型用法代码示例。如果您正苦于以下问题:PHP get_roles函数的具体用法?PHP get_roles怎么用?PHP get_roles使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了get_roles函数的17个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。

示例1: new_channel_content

function new_channel_content(&$a)
{
    if (!get_account_id()) {
        notice(t('Permission denied.') . EOL);
        return;
    }
    $name = x($_REQUEST, 'name') ? $_REQUEST['name'] : "";
    $nickname = x($_REQUEST, 'nickname') ? $_REQUEST['nickname'] : "";
    $privacy_role = x($_REQUEST, 'permissions_role') ? $_REQUEST['permissions_role'] : "";
    $o = replace_macros(get_markup_template('new_channel.tpl'), array('$title' => t('Add a Channel'), '$desc' => t('A channel is your own collection of related web pages. A channel can be used to hold social network profiles, blogs, conversation groups and forums, celebrity pages, and much more. You may create as many channels as your service provider allows.'), '$label_name' => t('Channel Name'), '$help_name' => t('Examples: "Bob Jameson", "Lisa and her Horses", "Soccer", "Aviation Group" '), '$label_nick' => t('Choose a short nickname'), '$nick_desc' => t('Your nickname will be used to create an easily remembered channel address (like an email address) which you can share with others.'), '$label_import' => t('Or <a href="import">import an existing channel</a> from another location'), '$name' => $name, '$help_role' => t('Please choose a channel type (such as social networking or community forum) and privacy requirements so we can select the best permissions for you'), '$role' => array('permissions_role', t('Channel Type'), $privacy_role ? $privacy_role : 'social', '<a href="help/roles" target="_blank">' . t('Read more about roles') . '</a>', get_roles()), '$nickname' => $nickname, '$submit' => t('Create')));
    return $o;
}
开发者ID:TamirAl,项目名称:hubzilla,代码行数:12,代码来源:new_channel.php


示例2: settings_content


//.........这里部分代码省略.........
        $perm_opts = array(array(t('Nobody except yourself'), 0), array(t('Only those you specifically allow'), PERMS_SPECIFIC), array(t('Approved connections'), PERMS_CONTACTS), array(t('Any connections'), PERMS_PENDING), array(t('Anybody on this website'), PERMS_SITE), array(t('Anybody in this network'), PERMS_NETWORK), array(t('Anybody authenticated'), PERMS_AUTHED), array(t('Anybody on the internet'), PERMS_PUBLIC));
        foreach ($global_perms as $k => $perm) {
            $options = array();
            foreach ($perm_opts as $opt) {
                if (!$perm[2] && $opt[1] == PERMS_PUBLIC) {
                    continue;
                }
                $options[$opt[1]] = $opt[0];
            }
            $permiss[] = array($k, $perm[3], $channel[$perm[0]], $perm[4], $options);
        }
        //		logger('permiss: ' . print_r($permiss,true));
        $username = $channel['channel_name'];
        $nickname = $channel['channel_address'];
        $timezone = $channel['channel_timezone'];
        $notify = $channel['channel_notifyflags'];
        $defloc = $channel['channel_location'];
        $maxreq = $channel['channel_max_friend_req'];
        $expire = $channel['channel_expire_days'];
        $adult_flag = intval($channel['channel_pageflags'] & PAGE_ADULT);
        $sys_expire = get_config('system', 'default_expire_days');
        //		$unkmail    = $a->user['unkmail'];
        //		$cntunkmail = $a->user['cntunkmail'];
        $hide_presence = intval(get_pconfig(local_channel(), 'system', 'hide_online_status'));
        $expire_items = get_pconfig(local_channel(), 'expire', 'items');
        $expire_items = $expire_items === false ? '1' : $expire_items;
        // default if not set: 1
        $expire_notes = get_pconfig(local_channel(), 'expire', 'notes');
        $expire_notes = $expire_notes === false ? '1' : $expire_notes;
        // default if not set: 1
        $expire_starred = get_pconfig(local_channel(), 'expire', 'starred');
        $expire_starred = $expire_starred === false ? '1' : $expire_starred;
        // default if not set: 1
        $expire_photos = get_pconfig(local_channel(), 'expire', 'photos');
        $expire_photos = $expire_photos === false ? '0' : $expire_photos;
        // default if not set: 0
        $expire_network_only = get_pconfig(local_channel(), 'expire', 'network_only');
        $expire_network_only = $expire_network_only === false ? '0' : $expire_network_only;
        // default if not set: 0
        $suggestme = get_pconfig(local_channel(), 'system', 'suggestme');
        $suggestme = $suggestme === false ? '0' : $suggestme;
        // default if not set: 0
        $post_newfriend = get_pconfig(local_channel(), 'system', 'post_newfriend');
        $post_newfriend = $post_newfriend === false ? '0' : $post_newfriend;
        // default if not set: 0
        $post_joingroup = get_pconfig(local_channel(), 'system', 'post_joingroup');
        $post_joingroup = $post_joingroup === false ? '0' : $post_joingroup;
        // default if not set: 0
        $post_profilechange = get_pconfig(local_channel(), 'system', 'post_profilechange');
        $post_profilechange = $post_profilechange === false ? '0' : $post_profilechange;
        // default if not set: 0
        $blocktags = get_pconfig(local_channel(), 'system', 'blocktags');
        $blocktags = $blocktags === false ? '0' : $blocktags;
        $timezone = date_default_timezone_get();
        $opt_tpl = get_markup_template("field_checkbox.tpl");
        if (get_config('system', 'publish_all')) {
            $profile_in_dir = '<input type="hidden" name="profile_in_directory" value="1" />';
        } else {
            $profile_in_dir = replace_macros($opt_tpl, array('$field' => array('profile_in_directory', t('Publish your default profile in the network directory'), $profile['publish'], '', $yes_no)));
        }
        $suggestme = replace_macros($opt_tpl, array('$field' => array('suggestme', t('Allow us to suggest you as a potential friend to new members?'), $suggestme, '', $yes_no)));
        $subdir = strlen($a->get_path()) ? '<br />' . t('or') . ' ' . $a->get_baseurl(true) . '/channel/' . $nickname : '';
        $tpl_addr = get_markup_template("settings_nick_set.tpl");
        $prof_addr = replace_macros($tpl_addr, array('$desc' => t('Your channel address is'), '$nickname' => $nickname, '$subdir' => $subdir, '$basepath' => $a->get_hostname()));
        $stpl = get_markup_template('settings.tpl');
        $acl = new AccessList($channel);
        $perm_defaults = $acl->get();
        require_once 'include/group.php';
        $group_select = mini_group_select(local_channel(), $channel['channel_default_group']);
        require_once 'include/menu.php';
        $m1 = menu_list(local_channel());
        $menu = false;
        if ($m1) {
            $menu = array();
            $current = get_pconfig(local_channel(), 'system', 'channel_menu');
            $menu[] = array('name' => '', 'selected' => !$current ? true : false);
            foreach ($m1 as $m) {
                $menu[] = array('name' => htmlspecialchars($m['menu_name'], ENT_COMPAT, 'UTF-8'), 'selected' => $m['menu_name'] === $current ? ' selected="selected" ' : false);
            }
        }
        $evdays = get_pconfig(local_channel(), 'system', 'evdays');
        if (!$evdays) {
            $evdays = 3;
        }
        $permissions_role = get_pconfig(local_channel(), 'system', 'permissions_role');
        if (!$permissions_role) {
            $permissions_role = 'custom';
        }
        $permissions_set = $permissions_role != 'custom' ? true : false;
        $vnotify = get_pconfig(local_channel(), 'system', 'vnotify');
        $always_show_in_notices = get_pconfig(local_channel(), 'system', 'always_show_in_notices');
        if ($vnotify === false) {
            $vnotify = -1;
        }
        $o .= replace_macros($stpl, array('$ptitle' => t('Channel Settings'), '$submit' => t('Submit'), '$baseurl' => $a->get_baseurl(true), '$uid' => local_channel(), '$form_security_token' => get_form_security_token("settings"), '$nickname_block' => $prof_addr, '$h_basic' => t('Basic Settings'), '$username' => array('username', t('Full Name:'), $username, ''), '$email' => array('email', t('Email Address:'), $email, ''), '$timezone' => array('timezone_select', t('Your Timezone:'), $timezone, '', get_timezones()), '$defloc' => array('defloc', t('Default Post Location:'), $defloc, t('Geographical location to display on your posts')), '$allowloc' => array('allow_location', t('Use Browser Location:'), get_pconfig(local_channel(), 'system', 'use_browser_location') ? 1 : '', '', $yes_no), '$adult' => array('adult', t('Adult Content'), $adult_flag, t('This channel frequently or regularly publishes adult content. (Please tag any adult material and/or nudity with #NSFW)'), $yes_no), '$h_prv' => t('Security and Privacy Settings'), '$permissions_set' => $permissions_set, '$perms_set_msg' => t('Your permissions are already configured. Click to view/adjust'), '$hide_presence' => array('hide_presence', t('Hide my online presence'), $hide_presence, t('Prevents displaying in your profile that you are online'), $yes_no), '$lbl_pmacro' => t('Simple Privacy Settings:'), '$pmacro3' => t('Very Public - <em>extremely permissive (should be used with caution)</em>'), '$pmacro2' => t('Typical - <em>default public, privacy when desired (similar to social network permissions but with improved privacy)</em>'), '$pmacro1' => t('Private - <em>default private, never open or public</em>'), '$pmacro0' => t('Blocked - <em>default blocked to/from everybody</em>'), '$permiss_arr' => $permiss, '$blocktags' => array('blocktags', t('Allow others to tag your posts'), 1 - $blocktags, t('Often used by the community to retro-actively flag inappropriate content'), $yes_no), '$lbl_p2macro' => t('Advanced Privacy Settings'), '$expire' => array('expire', t('Expire other channel content after this many days'), $expire, sprintf(t('0 or blank to use the website limit. The website expires after %d days.'), intval($sys_expire))), '$maxreq' => array('maxreq', t('Maximum Friend Requests/Day:'), intval($channel['channel_max_friend_req']), t('May reduce spam activity')), '$permissions' => t('Default Post Permissions'), '$permdesc' => t("(click to open/close)"), '$aclselect' => populate_acl($perm_defaults, false), '$suggestme' => $suggestme, '$group_select' => $group_select, '$role' => array('permissions_role', t('Channel permissions category:'), $permissions_role, '', get_roles()), '$profile_in_dir' => $profile_in_dir, '$hide_friends' => $hide_friends, '$hide_wall' => $hide_wall, '$unkmail' => $unkmail, '$cntunkmail' => array('cntunkmail', t('Maximum private messages per day from unknown people:'), intval($channel['channel_max_anon_mail']), t("Useful to reduce spamming")), '$h_not' => t('Notification Settings'), '$activity_options' => t('By default post a status message when:'), '$post_newfriend' => array('post_newfriend', t('accepting a friend request'), $post_newfriend, '', $yes_no), '$post_joingroup' => array('post_joingroup', t('joining a forum/community'), $post_joingroup, '', $yes_no), '$post_profilechange' => array('post_profilechange', t('making an <em>interesting</em> profile change'), $post_profilechange, '', $yes_no), '$lbl_not' => t('Send a notification email when:'), '$notify1' => array('notify1', t('You receive a connection request'), $notify & NOTIFY_INTRO, NOTIFY_INTRO, '', $yes_no), '$notify2' => array('notify2', t('Your connections are confirmed'), $notify & NOTIFY_CONFIRM, NOTIFY_CONFIRM, '', $yes_no), '$notify3' => array('notify3', t('Someone writes on your profile wall'), $notify & NOTIFY_WALL, NOTIFY_WALL, '', $yes_no), '$notify4' => array('notify4', t('Someone writes a followup comment'), $notify & NOTIFY_COMMENT, NOTIFY_COMMENT, '', $yes_no), '$notify5' => array('notify5', t('You receive a private message'), $notify & NOTIFY_MAIL, NOTIFY_MAIL, '', $yes_no), '$notify6' => array('notify6', t('You receive a friend suggestion'), $notify & NOTIFY_SUGGEST, NOTIFY_SUGGEST, '', $yes_no), '$notify7' => array('notify7', t('You are tagged in a post'), $notify & NOTIFY_TAGSELF, NOTIFY_TAGSELF, '', $yes_no), '$notify8' => array('notify8', t('You are poked/prodded/etc. in a post'), $notify & NOTIFY_POKE, NOTIFY_POKE, '', $yes_no), '$lbl_vnot' => t('Show visual notifications including:'), '$vnotify1' => array('vnotify1', t('Unseen grid activity'), $vnotify & VNOTIFY_NETWORK, VNOTIFY_NETWORK, '', $yes_no), '$vnotify2' => array('vnotify2', t('Unseen channel activity'), $vnotify & VNOTIFY_CHANNEL, VNOTIFY_CHANNEL, '', $yes_no), '$vnotify3' => array('vnotify3', t('Unseen private messages'), $vnotify & VNOTIFY_MAIL, VNOTIFY_MAIL, t('Recommended'), $yes_no), '$vnotify4' => array('vnotify4', t('Upcoming events'), $vnotify & VNOTIFY_EVENT, VNOTIFY_EVENT, '', $yes_no), '$vnotify5' => array('vnotify5', t('Events today'), $vnotify & VNOTIFY_EVENTTODAY, VNOTIFY_EVENTTODAY, '', $yes_no), '$vnotify6' => array('vnotify6', t('Upcoming birthdays'), $vnotify & VNOTIFY_BIRTHDAY, VNOTIFY_BIRTHDAY, t('Not available in all themes'), $yes_no), '$vnotify7' => array('vnotify7', t('System (personal) notifications'), $vnotify & VNOTIFY_SYSTEM, VNOTIFY_SYSTEM, '', $yes_no), '$vnotify8' => array('vnotify8', t('System info messages'), $vnotify & VNOTIFY_INFO, VNOTIFY_INFO, t('Recommended'), $yes_no), '$vnotify9' => array('vnotify9', t('System critical alerts'), $vnotify & VNOTIFY_ALERT, VNOTIFY_ALERT, t('Recommended'), $yes_no), '$vnotify10' => array('vnotify10', t('New connections'), $vnotify & VNOTIFY_INTRO, VNOTIFY_INTRO, t('Recommended'), $yes_no), '$vnotify11' => array('vnotify11', t('System Registrations'), $vnotify & VNOTIFY_REGISTER, VNOTIFY_REGISTER, '', $yes_no), '$always_show_in_notices' => array('always_show_in_notices', t('Also show new wall posts, private messages and connections under Notices'), $always_show_in_notices, 1, '', $yes_no), '$evdays' => array('evdays', t('Notify me of events this many days in advance'), $evdays, t('Must be greater than 0')), '$h_advn' => t('Advanced Account/Page Type Settings'), '$h_descadvn' => t('Change the behaviour of this account for special situations'), '$pagetype' => $pagetype, '$expert' => feature_enabled(local_channel(), 'expert'), '$hint' => t('Please enable expert mode (in <a href="settings/features">Settings > Additional features</a>) to adjust!'), '$lbl_misc' => t('Miscellaneous Settings'), '$photo_path' => array('photo_path', t('Default photo upload folder'), get_pconfig(local_channel(), 'system', 'photo_path'), t('%Y - current year, %m -  current month')), '$attach_path' => array('attach_path', t('Default file upload folder'), get_pconfig(local_channel(), 'system', 'attach_path'), t('%Y - current year, %m -  current month')), '$menus' => $menu, '$menu_desc' => t('Personal menu to display in your channel pages'), '$removeme' => t('Remove Channel'), '$removechannel' => t('Remove this channel.'), '$firefoxshare' => t('Firefox Share $Projectname provider'), '$cal_first_day' => array('first_day', t('Start calendar week on monday'), get_pconfig(local_channel(), 'system', 'cal_first_day') ? 1 : '', '', $yes_no)));
        call_hooks('settings_form', $o);
        $o .= '</form>' . "\r\n";
        return $o;
    }
}
开发者ID:Gillesq,项目名称:hubzilla,代码行数:101,代码来源:settings.php


示例3: limited_or_full

$inherited_permissions = limited_or_full($inherited_permissions);
if (api_get_setting('permissions') == 'limited') {
    $header_array = $rights_limited;
}
if (api_get_setting('permissions') == 'full') {
    $header_array = $rights_full;
}
echo "<form method=\"post\" action=\"" . str_replace('&', '&amp;', $_SERVER['REQUEST_URI']) . "\">";
// ---------------------------------------------------
// 		DISPLAYING THE ROLES LIST
// ---------------------------------------------------
if (api_get_setting('group_roles') == 'true') {
    // the list of the roles for the user
    echo '<strong>' . get_lang('GroupRoles') . '</strong><br />';
    $current_group_course_roles = get_roles('group', $group_id);
    $current_group_platform_roles = get_roles('group', $group_id, 'platform');
    display_role_list($current_group_course_roles, $current_group_platform_roles);
    echo '<br />';
}
// ---------------------------------------------------
// 		DISPLAYING THE MATRIX (group permissions)
// ---------------------------------------------------
echo "<table class=\"data_table\">\n";
// the header
echo "\t<tr>\n";
echo "\t\t<th>" . get_lang('Module') . "</th>\n";
foreach ($header_array as $header_key => $header_value) {
    echo "\t\t<th>" . get_lang($header_value) . "</th>\n";
}
echo "\t</tr>\n";
// the main area with the checkboxes or images
开发者ID:ragebat,项目名称:chamilo-lms,代码行数:31,代码来源:group_permissions.inc.php


示例4: createMainMenu

include '../standard_header.inc.php';
# Dateiname und evtl. Pfad des Templates für die Webseite
$webseite = "role_show.dwt";
include "au_header.inc.php";
###############################################################################
#$mnr = $_GET['mnr'];
$mnr = 3;
$sbmnr = $_GET['sbmnr'];
# Menuleiste erstellen
createMainMenu($rollen, $mainnr);
createAUMenu($rollen, $mnr, $auDN, $sbmnr);
###############################################################################
# Admins anzeigen und loeschen
$role = $_GET['role'];
$roles_array = get_roles($auDN);
# print_r($roles_array);
# jeder Rolle entsprechend Members holen und Überschrift setzen
switch ($role) {
    case 'MainAdmin':
        $template->assign(array("ROLE" => "MainAdmin", "ROLE_DESC" => "Haupt Administratoren", "MENR" => $sbmnr));
        $members = $roles_array['MainAdmin'];
        break;
    case 'HostAdmin':
        $template->assign(array("ROLE" => "HostAdmin", "ROLE_DESC" => "Administratoren &nbsp;- &nbsp;Rechner", "MENR" => $sbmnr));
        $members = $roles_array['HostAdmin'];
        break;
    case 'DhcpAdmin':
        $template->assign(array("ROLE" => "DhcpAdmin", "ROLE_DESC" => "Administratoren &nbsp;- &nbsp;DHCP", "MENR" => $sbmnr));
        $members = $roles_array['DhcpAdmin'];
        break;
开发者ID:BackupTheBerlios,项目名称:openslx-svn,代码行数:30,代码来源:role_show.php


示例5: get

 function get()
 {
     $registration_is = '';
     $other_sites = '';
     if (get_config('system', 'register_policy') == REGISTER_CLOSED) {
         if (get_config('system', 'directory_mode') == DIRECTORY_MODE_STANDALONE) {
             notice(t('Registration on this hub is disabled.') . EOL);
             return;
         }
         $mod = new Pubsites();
         return $mod->get();
     }
     if (get_config('system', 'register_policy') == REGISTER_APPROVE) {
         $registration_is = t('Registration on this hub is by approval only.');
         $other_sites = t('<a href="pubsites">Register at another affiliated hub.</a>');
     }
     $max_dailies = intval(get_config('system', 'max_daily_registrations'));
     if ($max_dailies) {
         $r = q("select count(account_id) as total from account where account_created > %s - INTERVAL %s", db_utcnow(), db_quoteinterval('1 day'));
         if ($r && $r[0]['total'] >= $max_dailies) {
             logger('max daily registrations exceeded.');
             notice(t('This site has exceeded the number of allowed daily account registrations. Please try again tomorrow.') . EOL);
             return;
         }
     }
     // Configurable terms of service link
     $tosurl = get_config('system', 'tos_url');
     if (!$tosurl) {
         $tosurl = z_root() . '/help/TermsOfService';
     }
     $toslink = '<a href="' . $tosurl . '" target="_blank">' . t('Terms of Service') . '</a>';
     // Configurable whether to restrict age or not - default is based on international legal requirements
     // This can be relaxed if you are on a restricted server that does not share with public servers
     if (get_config('system', 'no_age_restriction')) {
         $label_tos = sprintf(t('I accept the %s for this website'), $toslink);
     } else {
         $label_tos = sprintf(t('I am over 13 years of age and accept the %s for this website'), $toslink);
     }
     $enable_tos = 1 - intval(get_config('system', 'no_termsofservice'));
     $email = array('email', t('Your email address'), x($_REQUEST, 'email') ? strip_tags(trim($_REQUEST['email'])) : "");
     $password = array('password', t('Choose a password'), x($_REQUEST, 'password') ? trim($_REQUEST['password']) : "");
     $password2 = array('password2', t('Please re-enter your password'), x($_REQUEST, 'password2') ? trim($_REQUEST['password2']) : "");
     $invite_code = array('invite_code', t('Please enter your invitation code'), x($_REQUEST, 'invite_code') ? strip_tags(trim($_REQUEST['invite_code'])) : "");
     $name = array('name', t('Name or caption'), x($_REQUEST, 'name') ? $_REQUEST['name'] : '', t('Examples: "Bob Jameson", "Lisa and her Horses", "Soccer", "Aviation Group"'));
     $nickhub = '@' . str_replace(array('http://', 'https://', '/'), '', get_config('system', 'baseurl'));
     $nickname = array('nickname', t('Choose a short nickname'), x($_REQUEST, 'nickname') ? $_REQUEST['nickname'] : '', sprintf(t('Your nickname will be used to create an easy to remember channel address e.g. nickname%s'), $nickhub));
     $privacy_role = x($_REQUEST, 'permissions_role') ? $_REQUEST['permissions_role'] : "";
     $role = array('permissions_role', t('Channel role and privacy'), $privacy_role ? $privacy_role : 'social', t('Select a channel role with your privacy requirements.') . ' <a href="help/roles" target="_blank">' . t('Read more about roles') . '</a>', get_roles());
     $tos = array('tos', $label_tos, '', '', array(t('no'), t('yes')));
     $auto_create = UNO || get_config('system', 'auto_channel_create') ? true : false;
     $default_role = UNO ? 'social' : get_config('system', 'default_permissions_role');
     require_once 'include/bbcode.php';
     $o = replace_macros(get_markup_template('register.tpl'), array('$title' => t('Registration'), '$reg_is' => $registration_is, '$registertext' => bbcode(get_config('system', 'register_text')), '$other_sites' => $other_sites, '$invitations' => get_config('system', 'invitation_only'), '$invite_desc' => t('Membership on this site is by invitation only.'), '$invite_code' => $invite_code, '$auto_create' => $auto_create, '$name' => $name, '$role' => $role, '$default_role' => $default_role, '$nickname' => $nickname, '$enable_tos' => $enable_tos, '$tos' => $tos, '$email' => $email, '$pass1' => $password, '$pass2' => $password2, '$submit' => t('Register'), '$verify_note' => t('This site may require email verification after submitting this form. If you are returned to a login page, please check your email for instructions.')));
     return $o;
 }
开发者ID:einervonvielen,项目名称:hubzilla,代码行数:55,代码来源:Register.php


示例6: JSON_ENCODE

    if($_REQUEST['option']=="URSRC_tree_view"){
        $menunameradiovalues = $_GET['radio_value'];
        $URSRC_basic_roleval=str_replace("_"," ",$menunameradiovalues);
        $URSRC_getmenu_folder_values=URSRC_getmenu_folder($URSRC_basic_roleval);
        echo JSON_ENCODE($URSRC_getmenu_folder_values);
    }
    //FUNCTION to get basic menus
    if($_REQUEST['option']=="URSRC_tree_view_basic"){
        $menunameradiovalues = $_GET['radio_value'];
        $URSRC_basic_roleval=str_replace("_"," ",$menunameradiovalues);
        $URSRC_getmenu_folder_values=URSRC_getmenubasic_folder1();
        echo JSON_ENCODE($URSRC_getmenu_folder_values);
    }
    //FUNCTION TO LOAD INITIAL VALUES ROLE LST bX
    if($_REQUEST['option']=="ACCESS_RIGHTS_SEARCH_UPDATE_BASICROLE"){
        $URSRC_role_array=get_roles();
        echo JSON_ENCODE($URSRC_role_array);
    }
}
//
////function URSRC_unshare_document($loggin,$fileId){
////
////    global $con,$ClientId,$ClientSecret,$RedirectUri,$DriveScopes,$CalenderScopes,$Refresh_Token;
////    $drive = new Google_Client();
////    $drive->setClientId($ClientId);
////    $drive->setClientSecret($ClientSecret);
////    $drive->setRedirectUri($RedirectUri);
////    $drive->setScopes(array($DriveScopes,$CalenderScopes));
////    $drive->setAccessType('online');
////    $authUrl = $drive->createAuthUrl();
////    $refresh_token= $Refresh_Token;
开发者ID:Rajagunasekaran,项目名称:BACKUP,代码行数:31,代码来源:DB_ACCESS_RIGHTS_ACCESS_RIGHTS-SEARCH_UPDATE.php


示例7: array

        $emp_folderid = $folderData->id;
    }
    if ($formname == "login_fetch") {
        if ($emp_folderid == "") {
            echo "Error:Folder id Not present";
            exit;
        }
        $emp_uploadfiles = array($emp_uploadfileidlist, $emp_uploadfilenamelist, $emp_uploadfilelinklist);
        return $emp_uploadfiles;
    }
    return $emp_folderid;
}
if ($_REQUEST["option"] == "ACCESS_RIGHTS_SEARCH_UPDATE") {
    $str = '40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,1,2,69,70,71,72,95,113,114,132,133,136,137,138,146';
    $URSRC_errmsg = get_error_msg($str);
    $get_rolecreation_array = get_roles();
    $project_result = mysqli_query($con, "SELECT * FROM USER_RIGHTS_CONFIGURATION where URC_ID in (1,2,3) ");
    $get_project_array = array();
    while ($row = mysqli_fetch_array($project_result)) {
        $get_project_array[] = $row["URC_DATA"];
    }
    $emp_type = mysqli_query($con, "SELECT * FROM USER_RIGHTS_CONFIGURATION where CGN_ID =10 ");
    $get_emptype_array = array();
    while ($row = mysqli_fetch_array($emp_type)) {
        $get_emptype_array[] = $row["URC_DATA"];
    }
    $menuname_result = mysqli_query($con, "SELECT DISTINCT MP_MNAME FROM MENU_PROFILE MP,USER_RIGHTS_CONFIGURATION URC");
    $get_menuname_array = array();
    while ($row = mysqli_fetch_array($menuname_result)) {
        $get_menuname_array[] = $row["MP_MNAME"];
    }
开发者ID:Rajagunasekaran,项目名称:TS,代码行数:31,代码来源:TSLIB_COMMON.php


示例8: add

 public function add($edit_id = 0)
 {
     $form = $this->input->post();
     $form = $this->security->xss_clean($form);
     if (isset($form['edit_id'])) {
         $edit_id = $form['edit_id'];
     }
     $this->form_validation->set_rules($this->_validation_rules($edit_id));
     if ($this->form_validation->run()) {
         $this->ins_data['first_name'] = $form['first_name'];
         $this->ins_data['last_name'] = $form['last_name'];
         $this->ins_data['about'] = $form['about'];
         $this->ins_data['profile_name'] = $form['profile_name'];
         $this->ins_data['user_name'] = $form['user_name'];
         $this->ins_data['location'] = $form['location'];
         $this->ins_data['email'] = $form['email'];
         $this->ins_data['phone'] = $form['phone'];
         $this->ins_data['gender'] = $form['gender'];
         $this->ins_data['updated_time'] = date("Y-m-d H:i:s");
         $this->ins_data['dob'] = $form['dob'];
         $this->ins_data['updated_id'] = get_current_user_id();
         $this->ins_data['created_id'] = get_current_user_id();
         $this->ins_data['role'] = $form['role'];
         if (trim($form['password'])) {
             $this->ins_data['password'] = md5($form['password']);
         }
         if ($edit_id) {
             $this->user_model->update(array('id' => $edit_id), $this->ins_data);
             $this->service_message->set_flash_message("record_update_success");
             //log
             actionLogAdd('user', $edit_id, "User#{$edit_id} ({$form['user_name']}) record has been updated.");
         } else {
             $user_id = $this->user_model->insert($this->ins_data);
             $this->service_message->set_flash_message("record_insert_success");
             //log
             actionLogAdd('user', $user_id, "User#{$user_id} ({$form['user_name']}) record has been created.");
         }
         redirect("admin/user");
     }
     if ($edit_id) {
         $edit_data = $this->user_model->get_where(array('id' => $edit_id))->row_array();
         if (!$edit_data) {
             $this->service_message->set_flash_message("record_not_found_error");
             redirect("admin/user");
         }
         //unset password
         $edit_data['password'] = '';
         $this->data['form_data'] = $edit_data;
     } else {
         if ($form) {
             $this->data['form_data'] = $form;
             $this->data['form_data']['id'] = $edit_id ? $edit_id : 0;
         } else {
             $this->data['form_data'] = array("id" => '', 'first_name' => '', "last_name" => '', "email" => '', "phone" => '', "profile_name" => '', "role" => '', 'user_name' => '', 'password' => '', 'about' => '', 'location' => '', 'dob' => '', 'gender' => '');
         }
     }
     //Get roles
     $this->data['roles'] = get_roles();
     $this->layout->view("admin/user/add");
 }
开发者ID:ram-1501,项目名称:rs,代码行数:60,代码来源:user.php


示例9: new_channel_content

function new_channel_content(&$a)
{
    $acc = App::get_account();
    if (!$acc || $acc['account_id'] != get_account_id()) {
        notice(t('Permission denied.') . EOL);
        return;
    }
    $default_role = '';
    $aid = get_account_id();
    if ($aid) {
        $r = q("select count(channel_id) as total from channel where channel_account_id = %d", intval($aid));
        if ($r && !intval($r[0]['total'])) {
            $default_role = get_config('system', 'default_permissions_role');
        }
        $limit = account_service_class_fetch(get_account_id(), 'total_identities');
        if ($r && $limit !== false) {
            $channel_usage_message = sprintf(t("You have created %1\$.0f of %2\$.0f allowed channels."), $r[0]['total'], $limit);
        } else {
            $channel_usage_message = '';
        }
    }
    $name = array('name', t('Name or caption'), x($_REQUEST, 'name') ? $_REQUEST['name'] : '', t('Examples: "Bob Jameson", "Lisa and her Horses", "Soccer", "Aviation Group"'));
    $nickhub = '@' . App::get_hostname();
    $nickname = array('nickname', t('Choose a short nickname'), x($_REQUEST, 'nickname') ? $_REQUEST['nickname'] : '', sprintf(t('Your nickname will be used to create an easy to remember channel address e.g. nickname%s'), $nickhub));
    $privacy_role = x($_REQUEST, 'permissions_role') ? $_REQUEST['permissions_role'] : "";
    $role = array('permissions_role', t('Channel role and privacy'), $privacy_role ? $privacy_role : 'social', t('Select a channel role with your privacy requirements.') . ' <a href="help/roles" target="_blank">' . t('Read more about roles') . '</a>', get_roles());
    $o = replace_macros(get_markup_template('new_channel.tpl'), array('$title' => t('Create Channel'), '$desc' => t('A channel is your identity on this network. It can represent a person, a blog, or a forum to name a few. Channels can make connections with other channels to share information with highly detailed permissions.'), '$label_import' => t('or <a href="import">import an existing channel</a> from another location.'), '$name' => $name, '$role' => $role, '$default_role' => $default_role, '$nickname' => $nickname, '$submit' => t('Create'), '$channel_usage_message' => $channel_usage_message));
    return $o;
}
开发者ID:anmol26s,项目名称:hubzilla-yunohost,代码行数:29,代码来源:new_channel.php


示例10: delete_role_member

function delete_role_member($userDN, $role, $auDN, $domDN)
{
    global $ds, $suffix, $ldapError;
    $actroles = get_roles($auDN);
    #print_r($actroles);echo "<br>";
    #print(count($actroles['MainAdmin']));echo "<br>";
    $entry['member'] = $userDN;
    if ($domDN != "") {
        $actdnsroles = get_roles_dns($domDN);
        switch ($role) {
            case 'MainAdmin':
                $roleDN1 = "cn=" . $role . ",cn=roles," . $auDN;
                #$roleDN2 = "cn=".$role.",cn=roles,".$domDN;
                if (count($actroles['MainAdmin']) == 1) {
                    # || count($actdnsroles['MainAdmin']) == 1 ){
                    echo "Rolle <b>MainAdmin</b> muss mindestens ein Mitglied haben!<br>\n\t\t\t\t\t\t<b>{$userDN}</b> wird nicht gel&ouml;scht.<br><br>";
                } else {
                    $results1 = ldap_mod_del($ds, $roleDN1, $entry);
                    #$results2 = ldap_mod_del($ds,$roleDN2,$entry);
                }
                if ($results1) {
                    #&& $results2){
                    return 1;
                } else {
                    return 0;
                }
                break;
            case 'HostAdmin':
                $roleDN1 = "cn=" . $role . ",cn=roles," . $auDN;
                #$roleDN2 = "cn=".$role.",cn=roles,".$domDN;
                if (count($actroles['HostAdmin']) == 1) {
                    $results1 = ldap_delete($ds, $roleDN1);
                } else {
                    $results1 = ldap_mod_del($ds, $roleDN1, $entry);
                }
                #$results2 = ldap_mod_del($ds,$roleDN2,$entry);
                if ($results1) {
                    #&& $results2){
                    return 1;
                } else {
                    return 0;
                }
                break;
            case 'DhcpAdmin':
                $roleDN = "cn=" . $role . ",cn=roles," . $auDN;
                if (count($actroles['DhcpAdmin']) == 1) {
                    $results = ldap_delete($ds, $roleDN);
                } else {
                    $results = ldap_mod_del($ds, $roleDN, $entry);
                }
                if ($results) {
                    return 1;
                } else {
                    return 0;
                }
                break;
            case 'RbsAdmin':
                $roleDN = "cn=" . $role . ",cn=roles," . $auDN;
                if (count($actroles['RbsAdmin']) == 1) {
                    $results = ldap_delete($ds, $roleDN);
                } else {
                    $results = ldap_mod_del($ds, $roleDN, $entry);
                }
                if ($results) {
                    return 1;
                } else {
                    return 0;
                }
                break;
            case 'ZoneAdmin':
                $roleDN1 = "cn=" . $role . ",cn=roles," . $auDN;
                #$roleDN2 = "cn=".$role.",cn=roles,".$domDN;
                if (count($actroles['ZoneAdmin']) == 1) {
                    $results1 = ldap_delete($ds, $roleDN1);
                } else {
                    $results1 = ldap_mod_del($ds, $roleDN1, $entry);
                }
                #$results2 = ldap_mod_del($ds,$roleDN2,$entry);
                if ($results1) {
                    #&& $results2){
                    return 1;
                } else {
                    return 0;
                }
                break;
        }
    } else {
        switch ($role) {
            case 'MainAdmin':
                $roleDN = "cn=" . $role . ",cn=roles," . $auDN;
                if (count($actroles['MainAdmin']) == 1) {
                    echo "Rolle <b>MainAdmin</b> muss mindestens ein Mitglied haben!<br>\n\t\t\t\t\t\t<b>{$userDN}</b> wird nicht gel&oumlscht.<br><br>";
                } else {
                    $results = ldap_mod_del($ds, $roleDN, $entry);
                }
                if ($results) {
                    return 1;
                } else {
                    return 0;
                }
//.........这里部分代码省略.........
开发者ID:BackupTheBerlios,项目名称:openslx-svn,代码行数:101,代码来源:au_management_functions.php


示例11: get_role

 /**
  * Get Role of a user
  *
  * @param $id
  * @return mixed
  */
 function get_role($id)
 {
     return get_roles()[\App\User::find($id)->roles()->first()->role_id];
 }
开发者ID:soarmorrow,项目名称:grabage-collector,代码行数:10,代码来源:application_helper.php


示例12: json_decode

// ----------------------------------------------------------------------------
// Initialize return value.
// ----------------------------------------------------------------------------
$return_value = json_decode('{"debug": null, "data": {"success": false, "groups": null} }');
// Change debug member of return value, then get string rep of return value.
// Usage: die(bake_with_debug($return_value, 'Info about error...'));
//TODO: move to a utilities file.
function bake_with_debug($mutable_return_value, $debug_string)
{
    $mutable_return_value->debug = $debug_string;
    return json_encode($mutable_return_value);
}
// ----------------------------------------------------------------------------
// Get Role response data.
// ----------------------------------------------------------------------------
$student_list = get_roles('survey_1');
// ----------------------------------------------------------------------------
// Prepare input by mapping question numbers to role numbers.
// ----------------------------------------------------------------------------
// Bijective map.
$map_ques_to_role = array(15 => 1, 16 => 2, 17 => 3, 18 => 4);
// Modify $student_list, applying the map to question numbers.
foreach ($student_list as &$role_response_list) {
    foreach ($role_response_list as &$ques_resp_pair) {
        $question_num = $ques_resp_pair[0];
        $ques_resp_pair[0] = $map_ques_to_role[$question_num];
    }
}
// ----------------------------------------------------------------------------
// Invoke suggestion algorithm.
// ----------------------------------------------------------------------------
开发者ID:philkrie,项目名称:PandaHat,代码行数:31,代码来源:ComputeGroups.php


示例13: createMainMenu

$sbmnr = -1;
createMainMenu($rollen, $mainnr);
createAUMenu($rollen, $mnr, $auDN, $sbmnr);
###############################################################################
# MainpageData
# Parent AU, Email MainAdmin
$parentMA = 0;
$exp = explode(',', $auDN);
$parentau = array_slice($exp, 1, 1);
$parentau = substr($parentau[0], 3);
if ($parentau != "RIPM") {
    $length = count($exp);
    $out = array_slice($exp, 1, $length - 1);
    $parentauDN = implode(',', $out);
    if ($parentauDN == $rootAU) {
        $rol = get_roles($parentauDN);
        #print_r($rol); echo "<br>";
        if (in_array($userDN, $rol['MainAdmin'])) {
            #echo "PARENT AU MAINADMIN<br><br>";
            $parentMA = 1;
        }
        #$mainadminDN = $rol['MainAdmin'][0];
        #$emailMA = get_user_data($mainadminDN, array("mail"));
        #$emailCODE = "<a href'mailto:".$emailMA['mail']."' class='maillink' 	style='text-decoration:none'>".$emailMA['mail']."</a>";
    }
}
$template->assign(array("OU" => $au_ou, "CN" => $au_cn, "DSC" => $au_desc, "AUDN" => $auDN, "PARENTAU" => $parentau, "EMAILMA" => $emailCODE));
# MaxIPBlocks
$mipb = $au_mipb;
#print_r($mipb);echo "<br>";
$mipbs .= "";
开发者ID:BackupTheBerlios,项目名称:openslx-svn,代码行数:31,代码来源:au_show.php


示例14: filter_input

        include __DIR__ . "/view.php";
        break;
    case 'modify_admin':
        $choice = filter_input(INPUT_POST, 'choice');
        if ($choice == "Back") {
            header("Location: ..");
        }
        if ($choice == "Add Admin") {
            $usr_id = filter_input(INPUT_POST, 'user_drop');
            $usr_role_cde = filter_input(INPUT_POST, 'role_drop');
            add_admin($usr_id, $app_cde, $usr_role_cde);
        }
        $assigned_roles = get_assigned_roles();
        $users = get_users();
        $roles = get_roles();
        include __DIR__ . "/view.php";
        break;
    case 'delete_admin':
        $usr_id = filter_input(INPUT_GET, 'usrID');
        $usr_role_cde = filter_input(INPUT_GET, 'roleID');
        delete_admin($usr_id, $usr_role_cde);
        $assigned_roles = get_assigned_roles();
        $users = get_users();
        $roles = get_roles();
        include __DIR__ . "/view.php";
        break;
    default:
        display_error('Unknown account action: ' . $action);
        exit;
        break;
}
开发者ID:ATCS-BCA,项目名称:bca-apps,代码行数:31,代码来源:index.php


示例15: register_content

function register_content(&$a)
{
    $registration_is = '';
    $other_sites = '';
    if (get_config('system', 'register_policy') == REGISTER_CLOSED) {
        if (get_config('system', 'directory_mode') == DIRECTORY_MODE_STANDALONE) {
            notice(t('Registration on this site is disabled.') . EOL);
            return;
        }
        require_once 'mod/pubsites.php';
        return pubsites_content($a);
    }
    if (get_config('system', 'register_policy') == REGISTER_APPROVE) {
        $registration_is = t('Registration on this site/hub is by approval only.');
        $other_sites = t('<a href="pubsites">Register at another affiliated site/hub</a>');
    }
    $max_dailies = intval(get_config('system', 'max_daily_registrations'));
    if ($max_dailies) {
        $r = q("select count(account_id) as total from account where account_created > %s - INTERVAL %s", db_utcnow(), db_quoteinterval('1 day'));
        if ($r && $r[0]['total'] >= $max_dailies) {
            logger('max daily registrations exceeded.');
            notice(t('This site has exceeded the number of allowed daily account registrations. Please try again tomorrow.') . EOL);
            return;
        }
    }
    // Configurable terms of service link
    $tosurl = get_config('system', 'tos_url');
    if (!$tosurl) {
        $tosurl = $a->get_baseurl() . '/help/TermsOfService';
    }
    $toslink = '<a href="' . $tosurl . '" >' . t('Terms of Service') . '</a>';
    // Configurable whether to restrict age or not - default is based on international legal requirements
    // This can be relaxed if you are on a restricted server that does not share with public servers
    if (get_config('system', 'no_age_restriction')) {
        $label_tos = sprintf(t('I accept the %s for this website'), $toslink);
    } else {
        $label_tos = sprintf(t('I am over 13 years of age and accept the %s for this website'), $toslink);
    }
    $enable_tos = 1 - intval(get_config('system', 'no_termsofservice'));
    $email = x($_REQUEST, 'email') ? strip_tags(trim($_REQUEST['email'])) : "";
    $password = x($_REQUEST, 'password') ? trim($_REQUEST['password']) : "";
    $password2 = x($_REQUEST, 'password2') ? trim($_REQUEST['password2']) : "";
    $invite_code = x($_REQUEST, 'invite_code') ? strip_tags(trim($_REQUEST['invite_code'])) : "";
    $name 

鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP get_roles_for_contextlevels函数代码示例发布时间:2022-05-15
下一篇:
PHP get_role_users函数代码示例发布时间:2022-05-15
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap