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

PHP user_is_administrator函数代码示例

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

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



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

示例1: prepare_user_name

/**
 * prepares the name of the user given the id.  also makes it an email link.
 * @param int $p_user_id
 * @return string
 */
function prepare_user_name($p_user_id)
{
    # Catch a user_id of NO_USER (like when a handler hasn't been assigned)
    if (NO_USER == $p_user_id) {
        return '';
    }
    $t_username = user_get_name($p_user_id);
    if (user_exists($p_user_id) && user_get_field($p_user_id, 'enabled')) {
        $t_username = string_display_line($t_username);
        // WK/BFE: Original-Zeile auskommentiert: , LB/BFE 2015
        //		return '<a href="' . string_sanitize_url( 'view_user_page.php?id=' . $p_user_id, true ) . '">' . $t_username . '</a>';
        // ersetzt durch: (Link auf view_user_page nur wenn globale Rolle mindestens $g_manage_user_threshold
        if (user_is_administrator(auth_get_current_user_id())) {
            return '<a href="' . string_sanitize_url('view_user_page.php?id=' . $p_user_id, true) . '">' . $t_username . '</a>';
        } else {
            return $t_username;
        }
        // WK/BFE: Ende der Modifikation
    } else {
        $t_result = '<font STYLE="text-decoration: line-through">';
        $t_result .= string_display_line($t_username);
        $t_result .= '</font>';
        return $t_result;
    }
}
开发者ID:bfekomsthoeft,项目名称:TTS_Praxisprojekt1,代码行数:30,代码来源:prepare_api.php


示例2: user_delete

function user_delete($username_to_delete)
{
    if (!$username_to_delete) {
        redirect('/');
    }
    if (($username_to_delete == $_SERVER['USER'] || user_is_administrator()) && user_is_valid($_SERVER['USERINFO_ARRAY']['username'], $_SERVER['USERINFO_ARRAY']['userpass'])) {
        $userdir = "{$_SERVER['PWUSERS_DIR']}/{$username_to_delete}";
        exec("rm -fR {$userdir}", $delresults);
        exec("grep -rli {$username_to_delete} {$_SERVER['PWUSERS_DIR']}/*/watchedlist.txt", $watchedlists);
        foreach ($watchedlists as $watched) {
            $data = file_get_contents($watched);
            if (strstr($data, "!{$planowner}")) {
                preg_match("|(!{$planowner}.*!)|", $data, $matches);
                $remove = $matches[0];
            } else {
                $remove = "\n{$planowner}\n";
            }
            // remove whatever we found
            $data = str_replace($remove, '', $data);
            // break down multiple linebreaks so the list doesn't look weird in the edit view
            $data = str_replace("\n\n", "\n", $data);
            file_put_contents($watched, $data);
        }
    } else {
        output("Error deleting {$username_to_delete}", "\n\t<div class='alert'>\n\tYou can't delete {$username_to_delete}. Talk to an\n\t<a href='mailto:[email protected]'>admin</a>.\n\tClick <a href='{$_SERVER['WEB_ROOT']}/'>here</a> to go back to the main page.\n\t</div>\n\t");
    }
    if ($username_to_delete == $user) {
        logout("{$username_to_delete} has been deleted.");
    } else {
        redirect('/');
    }
}
开发者ID:joshuawdavidson,项目名称:planwatch,代码行数:32,代码来源:users.php


示例3: print_document_selection

/**
 * @param $types
 */
function print_document_selection($types)
{
    $project_id = gpc_get_int('project_id', helper_get_current_project());
    $specmanagement_database_api = new specmanagement_database_api();
    echo '<select name="version_id">';
    foreach ($types as $type) {
        $type_string = string_html_specialchars($type);
        $type_id = $specmanagement_database_api->get_type_id($type);
        $version_id_array = get_version_ids($type_id, $project_id);
        foreach ($version_id_array as $version_id) {
            $version_spec_project_id = version_get_field($version_id, 'project_id');
            if (project_includes_user($version_spec_project_id, auth_get_current_user_id()) || user_is_administrator(auth_get_current_user_id())) {
                $version_string = version_full_name($version_id);
                echo '<option value="' . $version_id . '">';
                echo $type_string . " - " . $version_string;
                echo '</option>';
            }
        }
    }
    echo '</select>';
}
开发者ID:Cre-ator,项目名称:Whiteboard.SpecificationManagement-Plugin,代码行数:24,代码来源:choose_document.php


示例4: menu

 function menu()
 {
     if (plugin_config_get('show_menu')) {
         require_once __DIR__ . DIRECTORY_SEPARATOR . 'core' . DIRECTORY_SEPARATOR . 'wmApi.php';
         $projectId = helper_get_current_project();
         $userId = auth_get_current_user_id();
         $userAccessLevel = user_get_access_level($userId, $projectId);
         $whiteboardPlugins = wmApi::getWhiteboardPlugins();
         $showMenu = false;
         foreach ($whiteboardPlugins as $whiteboardPlugin) {
             $pluginAccessLevel = $whiteboardPlugin[2];
             if (user_is_administrator($userId) || $userAccessLevel >= $pluginAccessLevel) {
                 $showMenu = true;
                 break;
             }
         }
         if ($showMenu) {
             return '<a href="' . plugin_page('whiteboard_menu') . '">' . plugin_lang_get('menu_title') . '</a>';
         }
     }
     return null;
 }
开发者ID:Cre-ator,项目名称:Whiteboard.Menu-Plugin,代码行数:22,代码来源:WhiteboardMenu.php


示例5: users_get_list

function users_get_list()
{
    $list = array();
    if (user_is_administrator()) {
        $list_fn = "{$_SERVER['FILE_ROOT']}/stats/userlist_all.txt";
    } else {
        $list_fn = "{$_SERVER['FILE_ROOT']}/stats/userlist_public.txt";
    }
    if (file_exists($list_fn) && @filemtime($list_fn) > time() - 3600 * 12) {
        $list = @file($list_fn);
    } else {
        exec("ls -d {$_SERVER['PWUSERS_DIR']}/" . "*" . "/", $ulist);
        foreach ($ulist as $listuser) {
            parse_str(user_read_info(basename($listuser)), $tempuser);
            if ($tempuser['rlpref'] == 1) {
                $list[] = basename($listuser);
            }
            if (is_dir("{$_SERVER['PWUSERS_DIR']}/" . basename($listuser))) {
                $list_all[] = basename($listuser);
            }
        }
        file_put_contents("{$_SERVER['FILE_ROOT']}/stats/userlist.txt", implode("\n", $list));
        file_put_contents("{$_SERVER['FILE_ROOT']}/stats/userlist_all.txt", implode("\n", $list_all));
        if (user_is_administrator()) {
            $list = $list_all;
        }
    }
    return $list;
}
开发者ID:joshuawdavidson,项目名称:planwatch,代码行数:29,代码来源:user_info_functions.php


示例6: form_security_validate

form_security_validate('manage_user_delete');

auth_reauthenticate();
access_ensure_global_level( config_get( 'manage_user_threshold' ) );

$f_user_id	= gpc_get_int( 'user_id' );

$t_user = user_get_row( $f_user_id );

# Ensure that the account to be deleted is of equal or lower access to the
# current user.
access_ensure_global_level( $t_user['access_level'] );

# check that we are not deleting the last administrator account
$t_admin_threshold = config_get_global( 'admin_site_threshold' );
if ( user_is_administrator( $f_user_id ) &&
	 user_count_level( $t_admin_threshold ) <= 1 ) {
	trigger_error( ERROR_USER_CHANGE_LAST_ADMIN, ERROR );
}

# If an administrator is trying to delete their own account, use
# account_delete.php instead as it is handles logging out and redirection
# of users who have just deleted their own accounts.
if ( auth_get_current_user_id() == $f_user_id ) {
	form_security_purge( 'manage_user_delete' );
	print_header_redirect( 'account_delete.php?account_delete_token=' . form_security_token( 'account_delete' ), true, false );
}

helper_ensure_confirmed( lang_get( 'delete_account_sure_msg' ) .
	'<br/>' . lang_get( 'username_label' ) . lang_get( 'word_separator' ) . $t_user['username'],
	lang_get( 'delete_account_button' ) );
开发者ID:rombert,项目名称:mantisbt,代码行数:31,代码来源:manage_user_delete.php


示例7: filter_db_can_delete_filter

/**
 *  Check if the current user has permissions to delete the stored query
 * @param $p_filter_id
 * @return bool
 */
function filter_db_can_delete_filter($p_filter_id)
{
    $t_filters_table = db_get_table('filters');
    $c_filter_id = db_prepare_int($p_filter_id);
    $t_user_id = auth_get_current_user_id();
    # Administrators can delete any filter
    if (user_is_administrator($t_user_id)) {
        return true;
    }
    $query = "SELECT id\n\t\t\t\t  FROM {$t_filters_table}\n\t\t\t\t  WHERE id=" . db_param() . "\n\t\t\t\t  AND user_id=" . db_param() . "\n\t\t\t\t  AND project_id!=" . db_param();
    $result = db_query_bound($query, array($c_filter_id, $t_user_id, -1));
    if (db_num_rows($result) > 0) {
        return true;
    }
    return false;
}
开发者ID:nextgens,项目名称:mantisbt,代码行数:21,代码来源:filter_api.php


示例8: plan_write_journaling

function plan_write_journaling($edit, $plandata, $private, $nolinebreaks = FALSE, $writer = FALSE)
{
    include_once 'plan_read.php';
    include_once 'snoop.php';
    include_once 'spiel.php';
    include_once 'send.php';
    $planowner = $writer;
    // make sure all the timecodes are the same
    $time = time();
    // find the character encoding of the plan entry, convert it to something
    // more universal
    mb_detect_order("UTF-8, UTF-8, Windows-1252");
    if (mb_detect_encoding($plandata) == "Windows-1252") {
        $plandata = mb_convert_encoding($plandata, UTF - 8, Windows - 1252);
    }
    // make sure no one can post an update to someone else's plan
    // this will need to be smarter if we ever implement group plans
    // but probably we won't, so no biggie.
    if ($planowner != $_SERVER['USER'] && !user_is_administrator()) {
        $planowner = $_SERVER['USER'];
    }
    $plan_dir = "{$_SERVER['PWUSERS_DIR']}/{$planowner}/plan";
    // Find the old snoops. We have to masquerade briefly as 'cacheuser' to do
    // this without leaving a spurious snitch or getting private entries.
    // We remain 'cacheuser' until after snoop_add() below.
    $_SERVER['USER'] = 'cacheuser';
    // find old snoops, for later clearing
    $old_snoop_array = snoop_find(plan_read_local($planowner, $_SERVER['USERINFO_ARRAY']['defaultdays'] + 3 . 'd'), $planowner);
    // delete the (now-invalid) cache files
    cache_clear($planowner);
    // leave a reminder to plan_read_local to ignore linebreaks.
    if ($nolinebreaks) {
        $plandata .= "<!--nolinebreaks-->";
    }
    if ($_POST['title']) {
        $plandata .= "<!--title {$_POST['title']} -->";
    }
    if ($_POST['tags']) {
        $plandata .= "<!--tags {$_POST['tags']} -->";
    }
    // if we weren't editing an existing (already-posted) entry, set the filename for the current time.
    if (!$_POST['edit'] || $_POST['edit'] == $_POST['draft_edit']) {
        $_POST['edit'] = ".{$time}";
    }
    $plan_fn = "{$plan_dir}/plan{$_POST['edit']}.txt{$_POST['private']}";
    if (!file_exists($plan_fn)) {
        file_put_contents("{$_SERVER['PWUSERS_DIR']}/{$planowner}/stats/lastupdate", $time);
    }
    if ($_FILES['attached_file']['tmp_name']) {
        rename("{$_FILES['attached_file']['tmp_name']}", "{$_SERVER['USER_ROOT']}/files/{$_FILES['attached_file']['name']}");
        if (strstr($_FILES['attached_file']['name'], 'jpg') || strstr($_FILES['attached_file']['name'], 'gif') || strstr($_FILES['attached_file']['name'], 'png')) {
            $plandata .= "<img src='/userfiles/view/{$writer}/{$_FILES['attached_file']['name']}' />";
        } else {
            $plandata .= "\n<a href='/userfiles/view/{$writer}/{$_FILES['attached_file']['name']}'>{$_FILES['attached_file']['name']}</a>";
        }
    }
    //	else trigger_error("No Files Uploaded");
    $plandata .= $_POST['markdown'];
    $plandata .= $_POST['nofeed'];
    // save old headers and footers.
    if (strstr($plan_fn, 'header') || strstr($plan_fn, 'footer')) {
        exec("mv {$plan_fn} {$plan_fn}.{$time}");
    }
    // write the update to disk.
    file_put_contents($plan_fn, $plandata);
    // new feature: SPIEL
    // here's the part where spiels are found
    // TODO(v4.5): replace spiel syntax with hashtags
    if (!$private && !$edit) {
        spiel_find($plandata, $planowner, $time);
    }
    // here's the part where sends are found
    if (!$private && !$edit) {
        send_find($plandata, $planowner, $time);
    }
    if (file_exists($plan_fn)) {
        if ($private && file_exists("{$plan_dir}/plan{$edit}.txt")) {
            exec("mv {$plan_dir}/plan{$edit}.txt {$plan_dir}/rem.plan{$edit}.txt");
        }
        if (!$private && file_exists("{$plan_dir}/plan{$edit}.txt.p")) {
            exec("mv {$plan_dir}/plan{$edit}.txt.p {$plan_dir}/rem.plan{$edit}.txt.p");
        }
        if ($_POST['draft_edit'] && file_exists("{$plan_dir}/draft{$_POST['draft_edit']}.txt")) {
            unlink("{$plan_dir}/draft{$_POST['draft_edit']}.txt");
        }
        // clean up old drafts
        if ($drafts = files_list("{$plan_dir}/", "draft*.txt")) {
            foreach ($drafts as $draft) {
                if (filemtime("{$plan_dir}/{$draft}") < time() - 7 * 24 * 3600) {
                    unlink("{$plan_dir}/{$draft}");
                }
            }
        }
    }
    @chmod($plan_fn, 0755);
    // clean old snoops and add new ones
    $new_snoop_array = snoop_find(plan_read_local($planowner), $planowner);
    $snoops_to_remove = array_unique(array_diff($old_snoop_array, $new_snoop_array));
    $snoops_to_set = array_unique(array_diff($new_snoop_array, $old_snoop_array));
    $remove_status = snoop_clean($snoops_to_remove, $planowner);
//.........这里部分代码省略.........
开发者ID:joshuawdavidson,项目名称:planwatch,代码行数:101,代码来源:plan_update.php


示例9: printWhiteboardMenu

 /**
  * print menu entrys for each plugin
  */
 public static function printWhiteboardMenu()
 {
     $projectId = helper_get_current_project();
     $userId = auth_get_current_user_id();
     $userAccessLevel = user_get_access_level($userId, $projectId);
     $whiteboardPlugins = self::getWhiteboardPlugins();
     $whiteboardPluginCount = count($whiteboardPlugins);
     echo '<div class="table">';
     for ($index = 0; $index < $whiteboardPluginCount; $index++) {
         $whiteboardPlugin = $whiteboardPlugins[$index];
         $plugin = $whiteboardPlugin[1];
         $pluginAccessLevel = $whiteboardPlugin[2];
         $pluginShowMenu = $whiteboardPlugin[3];
         if ((user_is_administrator($userId) || $userAccessLevel >= $pluginAccessLevel) && $pluginShowMenu == 1) {
             if ($index > 0) {
                 echo '<div class="item">&nbsp;|&nbsp;</div>';
             }
             $pluginLink = $whiteboardPlugin[4];
             echo '<div class="item"><a href="' . $pluginLink . '">' . plugin_lang_get('menu_title', $plugin) . '</a></div>';
         }
     }
     echo '</div>';
 }
开发者ID:Cre-ator,项目名称:Whiteboard.Menu-Plugin,代码行数:26,代码来源:wmApi.php


示例10: print_test_warn_row

    if (print_test_row('check mssql textsize in php.ini...', ini_get('mssql.textlimit') != 4096, ini_get('mssql.textlimit'))) {
        print_test_warn_row('check mssql textsize in php.ini...', ini_get('mssql.textsize') == 2147483647, ini_get('mssql.textsize'));
    }
}
print_test_row('check variables_order includes GPCS', stristr(ini_get('variables_order'), 'G') && stristr(ini_get('variables_order'), 'P') && stristr(ini_get('variables_order'), 'C') && stristr(ini_get('variables_order'), 'S'), ini_get('variables_order'));
test_bug_download_threshold();
test_bug_attachments_allow_flags();
print_test_row('check mail configuration: send_reset_password = ON requires allow_blank_email = OFF', OFF == config_get_global('send_reset_password') || OFF == config_get_global('allow_blank_email'));
print_test_row('check mail configuration: send_reset_password = ON requires enable_email_notification = ON', OFF == config_get_global('send_reset_password') || ON == config_get_global('enable_email_notification'));
print_test_row('check mail configuration: allow_signup = ON requires enable_email_notification = ON', OFF == config_get_global('allow_signup') || ON == config_get_global('enable_email_notification'));
print_test_row('check mail configuration: allow_signup = ON requires send_reset_password = ON', OFF == config_get_global('allow_signup') || ON == config_get_global('send_reset_password'));
print_test_row('check language configuration: fallback_language is not \'auto\'', 'auto' != config_get_global('fallback_language'));
print_test_row('check configuration: allow_anonymous_login = ON requires anonymous_account to be set', OFF == config_get_global('allow_anonymous_login') || strlen(config_get_global('anonymous_account')) > 0);
$t_anon_user = false;
print_test_row('check configuration: anonymous_account is a valid username if set', strlen(config_get_global('anonymous_account')) > 0 ? ($t_anon_user = user_get_id_by_name(config_get_global('anonymous_account'))) !== false : TRUE);
print_test_row('check configuration: anonymous_account should not be an administrator', $t_anon_user ? !user_is_administrator($t_anon_user) : TRUE);
print_test_row('$g_bug_link_tag is not empty ("' . config_get_global('bug_link_tag') . '")', '' != config_get_global('bug_link_tag'));
print_test_row('$g_bugnote_link_tag is not empty ("' . config_get_global('bugnote_link_tag') . '")', '' != config_get_global('bugnote_link_tag'));
print_test_row('filters: dhtml_filters = ON requires use_javascript = ON', OFF == config_get_global('dhtml_filters') || ON == config_get_global('use_javascript'));
print_test_row('Phpmailer sendmail configuration requires escapeshellcmd. Please use a different phpmailer method if this is blocked.', PHPMAILER_METHOD_SENDMAIL != config_get('phpMailer_method') || PHPMAILER_METHOD_SENDMAIL == config_get('phpMailer_method') && function_exists('escapeshellcmd'));
print_test_row('Phpmailer sendmail configuration requires escapeshellarg. Please use a different phpmailer method if this is blocked.', PHPMAILER_METHOD_SENDMAIL != config_get('phpMailer_method') || PHPMAILER_METHOD_SENDMAIL == config_get('phpMailer_method') && function_exists('escapeshellarg'));
check_zend_optimiser_version();
if (plugin_is_installed('MantisGraph')) {
    plugin_push_current('MantisGraph');
    print_test_row('checking gd is enabled, and version 2...', get_gd_version() == 2);
    if (plugin_config_get('eczlibrary', ON) == OFF) {
        $t_jpgraph_path = config_get('absolute_path') . 'library' . DIRECTORY_SEPARATOR . 'jpgraph' . DIRECTORY_SEPARATOR;
        if (!file_exists($t_jpgraph_path . 'jpgraph.php')) {
            print_test_row('checking we can find jpgraph class files...', false);
        } else {
            require_once $t_jpgraph_path . 'jpgraph.php';
开发者ID:nourchene-benslimane,项目名称:mantisV0,代码行数:31,代码来源:check.php


示例11: filter_db_can_delete_filter

/**
 * Check if the current user has permissions to delete the stored query
 * @param integer $p_filter_id Filter id.
 * @return boolean
 */
function filter_db_can_delete_filter($p_filter_id)
{
    $c_filter_id = (int) $p_filter_id;
    $t_user_id = auth_get_current_user_id();
    # Administrators can delete any filter
    if (user_is_administrator($t_user_id)) {
        return true;
    }
    $t_query = 'SELECT id
				  FROM {filters}
				  WHERE id=' . db_param() . '
				  AND user_id=' . db_param() . '
				  AND project_id!=' . db_param();
    $t_result = db_query($t_query, array($c_filter_id, $t_user_id, -1));
    if (db_result($t_result) > 0) {
        return true;
    }
    return false;
}
开发者ID:vipjaven,项目名称:mantisbt,代码行数:24,代码来源:filter_api.php


示例12: db_prepare_string

$c_username = db_prepare_string($f_username);
$c_realname = db_prepare_string($f_realname);
$c_protected = db_prepare_bool($f_protected);
$c_enabled = db_prepare_bool($f_enabled);
$c_user_id = db_prepare_int($f_user_id);
$c_access_level = db_prepare_int($f_access_level);
$t_user_table = config_get('mantis_user_table');
$t_old_protected = user_get_field($f_user_id, 'protected');
# check that we are not downgrading the last administrator
$t_old_access = user_get_field($f_user_id, 'access_level');
if (ADMINISTRATOR == $t_old_access && $t_old_access != $f_access_level && 1 >= user_count_level(ADMINISTRATOR)) {
    trigger_error(ERROR_USER_CHANGE_LAST_ADMIN, ERROR);
}
# Project specific access rights override global levels, hence, for users who are changed
# to be administrators, we have to remove project specific rights.
if ($c_access_level >= ADMINISTRATOR && !user_is_administrator($c_user_id)) {
    user_delete_project_specific_access_levels($c_user_id);
}
# if the user is already protected and the admin is not removing the
#  protected flag then don't update the access level and enabled flag.
#  If the user was unprotected or the protected flag is being turned off
#  then proceed with a full update.
if ($f_protected && $t_old_protected) {
    $query = "UPDATE {$t_user_table}\n\t    \t\tSET username='{$c_username}', email='{$c_email}',\n\t    \t\t\tprotected='{$c_protected}', realname='{$c_realname}'\n\t    \t\tWHERE id='{$c_user_id}'";
} else {
    $query = "UPDATE {$t_user_table}\n\t    \t\tSET username='{$c_username}', email='{$c_email}',\n\t    \t\t\taccess_level='{$c_access_level}', enabled='{$c_enabled}',\n\t    \t\t\tprotected='{$c_protected}', realname='{$c_realname}'\n\t    \t\tWHERE id='{$c_user_id}'";
}
$result = db_query($query);
$t_redirect_url = 'manage_user_page.php';
html_page_top1();
if ($result) {
开发者ID:centaurustech,项目名称:BenFund,代码行数:31,代码来源:manage_user_update.php


示例13: current_user_is_administrator

/**
 * Returns true if the currently logged in user is has a role of administrator
 * or higher, false otherwise
 *
 * @return true: administrator; false: otherwise.
 * @access public
 */
function current_user_is_administrator()
{
    return user_is_administrator(auth_get_current_user_id());
}
开发者ID:fur81,项目名称:zofaxiopeu,代码行数:11,代码来源:current_user_api.php


示例14: is_admin_user

 function is_admin_user($p_user_id)
 {
     return user_is_administrator($p_user_id);
 }
开发者ID:CarlosPinedaT,项目名称:agileMantis,代码行数:4,代码来源:class_commonlib.php


示例15: output_build_reader_toolbar_mobile

function output_build_reader_toolbar_mobile($content)
{
    if ($_SERVER['URL_ARRAY'][3] == 'bio') {
        $is_bio = TRUE;
    } elseif ($_SERVER['URL_ARRAY'][1] == 'send') {
        $is_send = TRUE;
    } elseif (in_array('archives', $_SERVER['URL_ARRAY'])) {
        $is_archives = TRUE;
    } else {
        $is_plan = TRUE;
    }
    $planwatchlist = file_get_contents("{$_SERVER['USER_ROOT']}/watchedlist.txt");
    if ($is_send) {
        $_SERVER['PLANOWNER'] = $_SERVER['URL_ARRAY'][2];
        plan_get_owner_info($_SERVER['PLANOWNER']);
    }
    if (user_is_valid($_SERVER['USERINFO_ARRAY']['username'], $_SERVER['USERINFO_ARRAY']['userpass']) && $_SERVER['PLANOWNER'] && !strstr($content, '<h1>Plan Read Failed</h1>')) {
        profile('reader_toolbar', 'begin');
        if ($is_plan || $is_bio || $is_archives || $is_send && $_SERVER['URL_ARRAY'][2]) {
            // bio
            if ((file_exists("{$_SERVER['PWUSERS_DIR']}/{$_SERVER['PLANOWNER']}/bio.txt") || (strpos($_SERVER['PLANOWNER_REAL_LOCATION'], 'diaryland') || strpos($_SERVER['PLANOWNER_REAL_LOCATION'], 'livejournal'))) && !$is_bio) {
                $readertoolbar[] = "<a href='{$_SERVER['WEB_ROOT']}/read/{$_SERVER['PLANOWNER_REAL_LOCATION']}/bio'>bio</a>";
            }
            // send
            if ((strpos($_SERVER['PLANOWNER_REAL_LOCATION'], 'planworld.net') || strpos($_SERVER['PLANOWNER_REAL_LOCATION'], 'amherst.edu') || plan_is_local($_SERVER['PLANOWNER'])) && $_SERVER['PLANOWNER'] != $_SERVER['USER'] && !$is_send) {
                $send_files = files_list("{$_SERVER['USER_ROOT']}/sends", files_encode_safe_name("{$_SERVER['PLANOWNER']}") . "*");
                if (is_array($send_files)) {
                    $lastsend = formattime(filemtime("{$_SERVER['USER_ROOT']}/sends/" . end($send_files)));
                    if (strstr(end($send_files), '.new')) {
                        $lastsend .= " <b>NEW</b>";
                    }
                    $lastsend = "({$lastsend})";
                }
                $readertoolbar[] = "<a href='{$_SERVER['WEB_ROOT']}/send/{$_SERVER['PLANOWNER_REAL_LOCATION']}/'>send</a>";
            }
            // planread
            if ($is_send || $is_bio) {
                $readertoolbar[] = "<a href='{$_SERVER['WEB_ROOT']}/read/{$_SERVER['PLANOWNER_REAL_LOCATION']}/'>plan</a>";
            }
            // archives
            if (plan_has_archives($_SERVER['PLANOWNER_REAL_LOCATION'])) {
                if (!$is_archives) {
                    $readertoolbar[] = "<a href='{$_SERVER['WEB_ROOT']}/read/{$_SERVER['PLANOWNER']}/archives' >archives</a>";
                } else {
                    $readertoolbar[] = "<a href='{$_SERVER['WEB_ROOT']}/read/{$_SERVER['PLANOWNER']}' >plan</a>";
                }
            }
            // If the reader isn't watching the writer, offer the option
            if (!stristr($planwatchlist, $_SERVER['PLANOWNER']) && $is_plan) {
                $readertoolbar[] = "<span id='watch_link'><a href=\"javascript:loadXMLDoc('{$_SERVER['WEB_ROOT']}/lists/add_ajax/watched/!{$_SERVER['PLANOWNER_REAL_LOCATION']}:{$_SERVER['PLANOWNER_DISPLAY_NAME']}!',null,'planwatch');void(null);\" title='add {$_SERVER['PLANOWNER_DISPLAY_NAME']} to your watched list' >watch</a></span>";
            }
            // if writer isn't a blog or the same as reader, offer the option of
            // blocking, unblocking, allowing, or disallowing access to reader's plan
            if ($_SERVER['PLANOWNER'] != $_SERVER['USER'] && !strpos($_SERVER['PLANOWNER'], '://')) {
                // offer administrators a link to masquerade as writer
                // this is so it's easy to follow up on plan-reported bugs
                if (user_is_administrator() && file_exists("{$_SERVER['PWUSERS_DIR']}/{$_SERVER['PLANOWNER']}/userinfo.dat")) {
                    $readertoolbar[] = "<a href='{$_SERVER['WEB_ROOT']}/masq/on/{$_SERVER['PLANOWNER']}'>masq</a>";
                }
                if ($is_plan) {
                    $readertoolbar[] = "<a href='/lists/unread/{$_SERVER['PLANOWNER']}'>unread</a>";
                }
                if ($is_send) {
                    $readertoolbar[] = "<a href='/send/{$_SERVER['PLANOWNER']}/unread'>unread</a>";
                }
            }
            // make the links into a string for output.
            $readertoolbar = "<li class='toolbutton'>" . implode("</li><li class='toolbutton'>", $readertoolbar) . "</li>\n";
            $readertoolbar = str_replace("<li class='toolbutton'></li>", "", $readertoolbar);
            if (($lasttime = plan_get_last_update($_SERVER['PLANOWNER'])) && $is_plan) {
                $readertoolbar = "<li class='plan_data_block'>Last Update: " . formattime($lasttime) . "</li>" . $readertoolbar;
            }
            if ($lastlogin = plan_get_last_login($_SERVER['PLANOWNER'])) {
                if ($lastlogin > 1) {
                    $readertoolbar = "<li class='plan_data_block' id='lastaction'>Last Action: " . formattime($lastlogin) . "</li>" . $readertoolbar;
                }
            }
        }
        profile('reader_toolbar', 'end');
    }
    return $readertoolbar;
}
开发者ID:joshuawdavidson,项目名称:planwatch,代码行数:82,代码来源:output.php


示例16: if

<?php if( !$t_ldap ) { ?>
<div class="important-msg">
<?php
	if ( ( ON == config_get( 'send_reset_password' ) ) && ( ON == config_get( 'enable_email_notification' ) ) ) {
		echo lang_get( 'reset_password_msg' );
	} else {
		echo lang_get( 'reset_password_msg2' );
	}
?>
</div>
<?php } ?>

<!-- PROJECT ACCESS (if permissions allow) and user is not ADMINISTRATOR -->
<?php if ( access_has_global_level( config_get( 'manage_user_threshold' ) ) &&
    !user_is_administrator( $t_user_id ) ) {
?>
<div class="form-container">
	<h2><?php echo lang_get( 'add_user_title' ) ?></h2>
	<div class="field-container <?php echo helper_alternate_class_no_attribute(); ?>">
		<span class="display-label"><span><?php echo lang_get( 'assigned_projects_label' ) ?></span></span>
		<div class="input"><?php print_project_user_list( $t_user['id'] ) ?></div>
		<span class="label-style"></span>
	</div>
	<form id="manage-user-project-add-form" method="post" action="manage_user_proj_add.php">
		<fieldset>
			<?php echo form_security_field( 'manage_user_proj_add' ) ?>
			<input type="hidden" name="user_id" value="<?php echo $t_user['id'] ?>" />
			<div class="field-container <?php echo helper_alternate_class_no_attribute(); ?>">
				<label for="add-user-project-id"><span><?php echo lang_get( 'unassigned_projects_label' ) ?></span></label>
				<span class="select">
开发者ID:rombert,项目名称:mantisbt,代码行数:30,代码来源:manage_user_edit_page.php


示例17: displayfeature

function displayfeature($featurename = '')
{
    if (file_exists("{$_SERVER['FILE_ROOT']}/features/{$featurename}")) {
        parse_str(file_get_contents("{$_SERVER['FILE_ROOT']}/features/{$featurename}", 'r'));
        $real = 1;
    }
    if (!$response) {
        $response = 'none yet';
    }
    $content .= stripslashes("\n\t<h1>{$title}</h1>\n\tStatus:\t<b>{$status}</b><br />\n\tPriority: <b>{$priority}</b><br />\n\tTime Noticed: <b>{$time_noticed}</b><br />\n\tSubmitted by: <b>{$submitter}</b><br />\n\tIP: <b>{$ip}</b><br /><br />\n\tBrowser Used: <b>{$user_agent}</b><br /><br />\n\n\t<b>Description:</b><br />\n\t" . nl2br($note) . "\n\t<br /><br />\n\n\t<b>Response:</b><br />\n\t" . nl2br($response) . "\n\t<br /><br />\n");
    if (user_is_administrator() || $_SERVER['USER'] == $submitter) {
        $content .= "\t[ <a href='{$_SERVER['WEB_ROOT']}/feature/edit/{$featurename}'>edit</a> ]";
    }
    if ($real) {
        return $content;
    } else {
        return "<div class='alert'>We can't find a feature request or bug report by the name <i>{$featurename}</i>.</div>";
    }
}
开发者ID:joshuawdavidson,项目名称:planwatch,代码行数:19,代码来源:featurecreep.php


示例18: menus_populate

function menus_populate($button, $content = FALSE)
{
    switch ($button) {
        case "view":
            $links .= "<li>\n<!--\nTHE VIEW MENUBOX\n-->\n\n\t\t<i>read your own plan. you know, in case you forgot.</i></li>\n\n\n\t\t<li><a href='{$_SERVER['WEB_ROOT']}/view'>view your plan</a></li>\n\n\t\t<li><a href='{$_SERVER['WEB_ROOT']}/read/{$_SERVER['USER']}/bio'>view your bio</a></li>\n";
            if (plan_has_archives($_SERVER['USER'])) {
                $links .= "<li><a href='{$_SERVER['WEB_ROOT']}/read/{$_SERVER['USER']}/archives'>view your archives</a></li>\n";
            }
            if (plan_is_journaling($_SERVER['USER'])) {
                $links .= "<li><hr /><a href='{$_SERVER['WEB_ROOT']}/view/all_hidden'>view your hidden entries</a></li>\n\n\t\t<li><a href='{$_SERVER['WEB_ROOT']}/view/all_private'>view your private entries</a></li>\n";
            }
            break;
        case "write":
            $links .= "\n<!--\nTHE WRITE MENUBOX\n-->\n\n\t\t<li><i>write a plan update. you know you want to.</i></li>\n\n\t\t<li><a href='{$_SERVER['WEB_ROOT']}/write'>update your plan</a></li>\n\n\t\t<li><a href='{$_SERVER['WEB_ROOT']}/write/bio'>edit your bio</a></li>\n";
            if (user_is_administrator()) {
                $links .= "<li><a href='{$_SERVER['WEB_ROOT']}/write/system'>update the system plan</a></li>\n";
            }
            $links .= "<li><hr/>\n</li>\n\t\t<li><a href='{$_SERVER['WEB_ROOT']}/write/css'>change plan styles</a></li>\n\n\t\t<li><a href='{$_SERVER['WEB_ROOT']}/write/header'>change plan header</a></li>\n\n\t\t<li><a href='{$_SERVER['WEB_ROOT']}/write/footer'>change plan footer</a></li>\n";
            if (plan_is_journaling($_SERVER['USER'])) {
                $links .= "<li><a href='{$_SERVER['WEB_ROOT']}/write/divider'>change your divider</a></li>\n";
            }
            $links .= "<li><hr/></li>\n\t\t<li><a href='{$_SERVER['WEB_ROOT']}/send'>write a send</a></li>\n";
            if ($content && plan_is_journaling($_SERVER['USER']) && strstr($_SERVER['REQUEST_URI'], "/read/{$_SERVER['USER']}")) {
                preg_match_all('|entry_content_([0-9]+)|', $content, $matches);
                $matches = $matches[1];
                if (is_array($matches)) {
                    $links .= "<li><hr/>edit recent entries...</li>\n";
                    foreach ($matches as $match) {
                        $links .= "<li><a href='{$_SERVER['WEB_ROOT']}/write/.{$match}'>" . formattime($match) . "</a></li>\n";
                    }
                }
            }
            break;
        case "snitch":
            $links .= "\n<!--\nTHE SNITCH MENUBOX\n-->\n\n\t\t<li><i>snitch and other s-words.</i></li>\n\n\t\t<li><a href='{$_SERVER['WEB_ROOT']}/snitch'>snitch</a></li>\n";
            $links .= "<li><hr/>\n</li>\n\t\t<li><a href='{$_SERVER['WEB_ROOT']}/snoop'>snoop</a></li>\n\n\t\t<li><a href='{$_SERVER['WEB_ROOT']}/send'>send</a></li>\n";
            break;
        case "tools":
            $links .= "\n<!--\nTHE TOOLS MENUBOX\n-->\n";
            $links .= "<li><i>tools to maintain and customize your account</i></li>";
            $links .= "\n\t\t\t<li><a href='{$_SERVER['WEB_ROOT']}/feature/' title='report a bug or request a feature'>report a bug</a><br/><hr/></li>\n" . "<li><a href='{$_SERVER['WEB_ROOT']}/slogans/add' title='add your own pw.o slogan to the random selection'>add a new slogan</a><br/>\n\t\t\t<a href='{$_SERVER['WEB_ROOT']}/smileys/add' title='upload a new smiley for people to use on their plans'>add a new smiley</a><br/>\n\t\t\t<hr/></li>\n" . "<li><a href='{$_SERVER['WEB_ROOT']}/lists/edit/allowed' title='change who can read your private entries'>edit your allowed list</a><br/>\n\t\t\t<a href='{$_SERVER['WEB_ROOT']}/lists/edit/blocked' title='change who is prevented from reading you'>edit your blocked list</a><br/>\n\t\t\t<hr/>\n</li>" . "<li><a href='{$_SERVER['WEB_ROOT']}/prefs/styles'>customize colors</a></li>\n" . "<li><a href='{$_SERVER['WEB_ROOT']}/prefs/fonts'>customize fonts</a></li>\n" . "<li><a href='{$_SERVER['WEB_ROOT']}/prefs/custom_css' title='add custom css'>customize css</a></li>\n" . "<li><a href='{$_SERVER['WEB_ROOT']}/prefs/skin' title='pick a skin'>pick a skin</a></li>\n" . "<li><hr/></li>\n" . "<li><a href='{$_SERVER['WEB_ROOT']}/prefs/userinfo'>user settings</a></li>\n" . "<li><a href='{$_SERVER['WEB_ROOT']}/prefs/interface'>interface prefs</a></li>\n";
            //			."<li>skin preview:<br/> <!--SKIN_SELECTOR--></li>\n"
            break;
        case "<!--TIME-->":
            $links .= "<!--LOADTIME-->";
            break;
        case "watched":
            $links .= "\n\t\t\t<li><a href='{$_SERVER['WEB_ROOT']}/lists/edit/watched' title='edit your watched list'>edit</a></li>\n\t\t\t<li class='listheader'>move\n\t\t\t<a href='{$_SERVER['WEB_ROOT']}/lists/move/watched/top'>top</a>\n\t\t\t<a href='{$_SERVER['WEB_ROOT']}/lists/move/watched/left'>left</a>\n\t\t\t<a href='{$_SERVER['WEB_ROOT']}/lists/move/watched/right'>right</a></li>\n\t\t\t<!--<b>move AJAX</b>\n\t\t\t<li><a href=\"javascript:list_move('top');void(null);\">top</a></li>\n\t\t\t<li><a href=\"javascript:list_move('left');void(null);\">left</a></li>\n\t\t\t<li><a href=\"javascript:list_move('right');void(null);\">right</a></li>\n\t\t\t-->\n\t\t\t<li class='listheader'>sort\n\t\t\t<a href=\"javascript:loadXMLDoc('{$_SERVER['WEB_ROOT']}/lists/resort/name/ajax','','planwatch');void(null);\" title='sort alphabetically by name'>abc</a>\n\t\t\t<a href=\"javascript:loadXMLDoc('{$_SERVER['WEB_ROOT']}/lists/resort/time/ajax','','planwatch');void(null);\" title='sort by date and time'>321</a>\n\t\t\t<a href=\"javascript:loadXMLDoc('{$_SERVER['WEB_ROOT']}/lists/resort/inorder/ajax','','planwatch');void(null);\" title='do not sort, use in the order listed'>zfq</a></li>\n\t\t\t<li class='listheader'>status\n\t\t\t<a href='{$_SERVER['WEB_ROOT']}/lists/planwatch_mark_all_read' title='mark all plans as read'>update</a>\n\t\t\t<a href='{$_SERVER['WEB_ROOT']}/lists/planwatch_mark_all_unread' title='mark all plans as unread'>reset</a></li>\n\t\t\t<!--<li><b>lists</b></li>\n\t\t\t<li><a href='{$_SERVER['WEB_ROOT']}/lists/advertised_users' title='advertised users'>advertised users</a> </li>\n\t\t\t<li><a href='{$_SERVER['WEB_ROOT']}/lists/registered_users' title='registered users'>registered users</a></li>-->\n";
            break;
    }
    return $links;
}
开发者ID:joshuawdavidson,项目名称:planwatch,代码行数:52,代码来源:formatting_html.php


示例19: filter_get_bug_rows

该文章已有0人参与评论

请发表评论

全部评论

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

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

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

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

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