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

PHP exit_permission_denied函数代码示例

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

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



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

示例1: frs_admin_header

function frs_admin_header($params)
{
    global $group_id;
    /*
    	Are they logged in?
    */
    if (!session_loggedin()) {
        exit_not_logged_in();
    }
    $project =& group_get_object($group_id);
    if (!$project || !is_object($project)) {
        return;
    }
    $perm =& $project->getPermission(session_get_user());
    if (!$perm || !is_object($perm)) {
        return;
    }
    /*
    	Are they a release technician?
    */
    if (!$perm->isReleaseTechnician()) {
        exit_permission_denied();
    }
    frs_header($params);
}
开发者ID:neymanna,项目名称:fusionforge,代码行数:25,代码来源:frs_utils.php


示例2: PHPWikiServiceAdmin

 function PHPWikiServiceAdmin($id)
 {
     global $LANG, $is_wiki_page;
     //used so the search box will add the necessary element to the pop-up box
     $is_wiki_page = 1;
     $this->gid = (int) $id;
     if (empty($this->gid)) {
         exit_no_group();
     }
     if (!user_ismember($this->gid, 'W2')) {
         exit_permission_denied();
     }
     $this->wiki = new PHPWiki($this->gid);
     // If Wiki for project doesn't exist, propose creation...
     if (!$this->wiki->exist()) {
         header('Location: ' . PHPWIKI_PLUGIN_BASE_URL . '/index.php?group_id=' . $this->gid . '&view=install');
     }
     // Set language for phpWiki
     if ($this->wiki->getLanguage_id()) {
         define('DEFAULT_LANGUAGE', $this->wiki->getLanguage_id());
         $LANG = $this->wiki->getLanguage_id();
     }
 }
开发者ID:pombredanne,项目名称:tuleap,代码行数:23,代码来源:PHPWikiServiceAdmin.class.php


示例3: snippet_header

function snippet_header($params)
{
    global $is_snippet_page, $HTML, $feedback, $Language;
    if ($GLOBALS['sys_use_snippet'] == 0) {
        exit_permission_denied();
    }
    // LJ used so the search box will add the necessary element to the pop-up box
    // Codendi Specific
    $is_snippet_page = 1;
    $HTML->header($params);
    /*
    	Show horizontal links
    */
    echo '<H2>' . $params['title'] . '</H2>';
    echo '<P><B>';
    echo '<A HREF="/snippet/">' . $Language->getText('snippet_utils', 'browse') . '</A>
		 | <A HREF="/snippet/submit.php">' . $Language->getText('snippet_utils', 'create_s') . '</A>
		 | <A HREF="/snippet/package.php">' . $Language->getText('snippet_utils', 'create_p') . '</A></B>';
    if (isset($params['help']) && $params['help']) {
        echo ' | ' . help_button($params['help'], false, $Language->getText('global', 'help'));
    }
    echo '<P>';
    html_feedback_top($feedback);
}
开发者ID:nterray,项目名称:tuleap,代码行数:24,代码来源:snippet_utils.php


示例4: session_require

/**
 *	session_require() - Convenience function to easily enforce permissions
 *
 *	Calling page will terminate with error message if current user
 *	fails checks.
 *
 *	@param		array	Associative array specifying criteria
 *	@return does not return if check is failed
 *
 */
function session_require($req)
{
    if (!user_isloggedin()) {
        exit_not_logged_in();
        //exit_permission_denied();
    }
    if ($req['group']) {
        $group =& group_get_object($req['group']);
        if (!$group || !is_object($group)) {
            exit_error(_('Error'), _('Error creating group object'));
        } else {
            if ($group->isError()) {
                exit_error(_('Error'), $group->getErrorMessage());
            }
        }
        $perm =& $group->getPermission(session_get_user());
        if (!$perm || !is_object($perm)) {
            exit_error(_('Error'), _('Error creating permission object'));
        } else {
            if ($perm->isError()) {
                exit_error(_('Error'), $perm->getErrorMessage());
            }
        }
        if ($req['admin_flags']) {
            //$query .= " AND admin_flags = '$req[admin_flags]'";
            if (!$perm->isAdmin()) {
                exit_permission_denied();
            }
        } else {
            if (!$perm->isMember()) {
                exit_permission_denied();
            }
        }
    } else {
        if ($req['isloggedin']) {
            //no need to check as long as the check is present at top of function
        } else {
            exit_permission_denied();
        }
    }
}
开发者ID:neymanna,项目名称:fusionforge,代码行数:51,代码来源:session.php


示例5: checkPermissions

 /**
  * Check access permissions for wiki and wiki pages.
  *
  * Check restriction for:
  *  wiki: whole wiki can be restricted.
  *  wikipage: each page of the wiki can be restricted.
  */
 function checkPermissions()
 {
     // Check if user can access to whole wiki
     if (!$this->wiki->isAutorized(user_getid())) {
         $GLOBALS['Response']->addFeedback('error', $GLOBALS['Language']->getText('plugin_phpwiki_wikiservice', 'acces_denied_whole', session_make_url("/project/memberlist.php?group_id=" . $this->gid)), CODENDI_PURIFIER_DISABLED);
         exit_permission_denied();
     }
     // Check if user can access to selected page
     if (!empty($_REQUEST['pagename'])) {
         $wp = new PHPWikiPage($this->gid, $_REQUEST['pagename']);
         if (!$wp->isAutorized(user_getid())) {
             $GLOBALS['Response']->addFeedback('error', $GLOBALS['Language']->getText('plugin_phpwiki_wikiservice', 'acces_denied_page', session_make_url("/project/memberlist.php?group_id=" . $this->gid)), CODENDI_PURIFIER_DISABLED);
             exit_permission_denied();
         }
     }
 }
开发者ID:pombredanne,项目名称:tuleap,代码行数:23,代码来源:PHPWikiService.class.php


示例6: getIntFromRequest

            return "Next {$minutetime} Minutes";
        }
        return "Next {$timedifference} Seconds";
    }
}
//
//      get the Group object
//
$group_id = getIntFromRequest('group_id');
$group =& group_get_object($group_id);
if (!$group || !is_object($group)) {
    exit_no_group();
}
if ($group->isError()) {
    if ($group->isPermissionDeniedError()) {
        exit_permission_denied($group->getErrorMessage());
    } else {
        exit_error(_('Error'), $group->getErrorMessage());
    }
}
if (!$group_id && $form_grp) {
    $group_id = $form_grp;
}
site_project_header(array('title' => _('Project Member List'), 'group' => $group_id, 'toptab' => 'memberlist'));
echo _('<p>If you would like to contribute to this project by becoming a developer, contact one of the project admins, designated in bold text below.</p>');
$title_arr = array();
$title_arr[] = _('Developer');
$title_arr[] = _('Summary');
$title_arr[] = _('Open Date');
$title_arr[] = _('Last Modified');
echo $GLOBALS['HTML']->listTableTop($title_arr);
开发者ID:neymanna,项目名称:fusionforge,代码行数:31,代码来源:index.php


示例7: cancelChangeAndUserLdap

 /**
  * Hook
  */
 function cancelChangeAndUserLdap($params)
 {
     $um = UserManager::instance();
     $user = $um->getCurrentUser();
     if ($GLOBALS['sys_auth_type'] == 'ldap' && $user->getLdapId() != '') {
         if (!$this->hasLDAPWrite()) {
             exit_permission_denied();
         }
     }
 }
开发者ID:pombredanne,项目名称:tuleap,代码行数:13,代码来源:ldapPlugin.class.php


示例8: ExecuteAction

    /**
     *  ExecuteAction - Executes the action passed as parameter
     *
     *  @param  string	 action to execute.
     */
    function ExecuteAction($action)
    {
        global $HTML;
        if ($action == "change_status") {
            //change a forum
            $forum_name = getStringFromRequest('forum_name');
            $description = getStringFromRequest('description');
            $send_all_posts_to = getStringFromRequest('send_all_posts_to');
            $allow_anonymous = getIntFromRequest('allow_anonymous');
            $is_public = getIntFromRequest('is_public');
            $moderation_level = getIntFromRequest('moderation_level');
            $group_forum_id = getIntFromRequest('group_forum_id');
            /*
            	Change a forum
            */
            $f = new Forum($this->g, $group_forum_id);
            if (!$f || !is_object($f)) {
                exit_error(_('Error'), _('Error getting Forum'));
            } elseif ($f->isError()) {
                exit_error(_('Error'), $f->getErrorMessage());
            }
            if (!$f->userIsAdmin()) {
                exit_permission_denied();
            }
            if (!$f->update($forum_name, $description, $allow_anonymous, $is_public, $send_all_posts_to, $moderation_level)) {
                exit_error(_('Error'), $f->getErrorMessage());
            } else {
                $feedback = _('Forum Info Updated Successfully');
            }
            return $feedback;
        }
        if ($action == "add_forum") {
            //add forum
            $forum_name = getStringFromRequest('forum_name');
            $description = getStringFromRequest('description');
            $is_public = getStringFromRequest('is_public');
            $send_all_posts_to = getStringFromRequest('send_all_posts_to');
            $allow_anonymous = getStringFromRequest('allow_anonymous');
            $moderation_level = getIntFromRequest('moderation_level');
            /*
            	Adding forums to this group
            */
            if (!$this->p->isForumAdmin()) {
                form_release_key(getStringFromRequest("form_key"));
                exit_permission_denied();
            }
            $f = new Forum($this->g);
            if (!$f || !is_object($f)) {
                form_release_key(getStringFromRequest("form_key"));
                exit_error(_('Error'), _('Error getting Forum'));
            } elseif ($f->isError()) {
                form_release_key(getStringFromRequest("form_key"));
                exit_error(_('Error'), $f->getErrorMessage());
            }
            if (!$f->create($forum_name, $description, $is_public, $send_all_posts_to, 1, $allow_anonymous, $moderation_level)) {
                form_release_key(getStringFromRequest("form_key"));
                exit_error(_('Error'), $f->getErrorMessage());
            } else {
                $feedback = _('Forum created successfully');
            }
            return $feedback;
        }
        if ($action == "delete") {
            //Deleting messages or threads
            $msg_id = getStringFromRequest('deletemsg');
            $forum_id = getIntFromRequest('forum_id');
            $f = new Forum($this->g, $forum_id);
            if (!$f || !is_object($f)) {
                exit_error(_('Error'), _('Error getting Forum'));
            } elseif ($f->isError()) {
                exit_error(_('Error'), $f->getErrorMessage());
            }
            if (!$f->userIsAdmin()) {
                exit_permission_denied();
            }
            $fm = new ForumMessage($f, $msg_id);
            if (!$fm || !is_object($fm)) {
                exit_error(_('Error'), _('Error Getting ForumMessage'));
            } elseif ($fm->isError()) {
                exit_error(_('Error'), $fm->getErrorMessage());
            }
            $count = $fm->delete();
            if (!$count || $fm->isError()) {
                exit_error(_('Error'), $fm->getErrorMessage());
            } else {
                $feedback = sprintf(ngettext('%1$s message deleted', '%1$s messages deleted', $count), $count);
            }
            return $feedback;
        }
        if ($action == "delete_forum") {
            //delete the forum
            /*
            	Deleting entire forum
            */
            $group_forum_id = getIntFromRequest('group_forum_id');
//.........这里部分代码省略.........
开发者ID:neymanna,项目名称:fusionforge,代码行数:101,代码来源:ForumAdmin.class.php


示例9: session_require

/**
 *
 *   Method of easily enforcing permissions
 *   Page will terminate with error message if you fail checks
 *
 */
function session_require($req)
{
    if (!user_isloggedin()) {
        exit_permission_denied();
    }
    /*
    	SF Admins always have permission
    */
    if (user_is_super_user()) {
        return true;
    }
    if ($req['group']) {
        $group =& group_get_object($req['group']);
        if (!$group) {
            exit_no_group();
        }
        if ($req['admin_flags']) {
            //$query .= " AND admin_flags = '$req[admin_flags]'";
            if (!$group->userIsAdmin()) {
                exit_permission_denied();
            }
        } else {
            if (!$group->userIsMember()) {
                exit_permission_denied();
            }
        }
    } else {
        if ($req['isloggedin']) {
            //no need to check as long as the check is present at top of function
        } else {
            exit_permission_denied();
        }
    }
}
开发者ID:BackupTheBerlios,项目名称:berlios,代码行数:40,代码来源:session.php


示例10: session_require

/**
 *	session_require() - Convenience function to easily enforce permissions
 *
 *	Calling page will terminate with error message if current user
 *	fails checks.
 *
 *	@param		array	Associative array specifying criteria
 *	@return does not return if check is failed
 *
 */
function session_require($req)
{
    if (!session_loggedin()) {
        exit_not_logged_in();
    }
    if ($req['group']) {
        $group =& group_get_object($req['group']);
        if (!$group || !is_object($group)) {
            exit_error('Error', 'Could Not Get Group');
        } elseif ($group->isError()) {
            exit_error('Error', $group->getErrorMessage());
        }
        $perm =& $group->getPermission(session_get_user());
        if (!$perm || !is_object($perm) || $perm->isError()) {
            exit_permission_denied();
        }
        //don't really like this, but as admin_flags is not mandatory
        //I add @ to remove the warning
        if (@$req['admin_flags']) {
            if (!$perm->isAdmin()) {
                exit_permission_denied();
            }
        } else {
            if (!$perm->isMember()) {
                exit_permission_denied();
            }
        }
    } else {
        if ($req['isloggedin']) {
            //no need to check as long as the check is present at top of function
        } else {
            exit_permission_denied();
        }
    }
}
开发者ID:neymanna,项目名称:fusionforge,代码行数:45,代码来源:session.php


示例11: exit_no_group

//
// SourceForge: Breaking Down the Barriers to Open Source Development
// Copyright 1999-2000 (c) The SourceForge Crew
// http://sourceforge.net
//
// $Id: submit.php,v 1.3 2004/01/13 13:15:24 helix Exp $
require 'pre.php';
require '../forum/forum_utils.php';
if (user_isloggedin()) {
    //news must now be submitted from a project page -
    if (!$group_id) {
        exit_no_group();
    }
    if (!user_ismember($group_id, 'A')) {
        exit_permission_denied('You cannot submit news ' . 'for a project unless you are an admin on that project');
    }
    if ($post_changes) {
        //check to make sure both fields are there
        if ($summary && $details) {
            /*
            	Insert the row into the db if it's a generic message
            	OR this person is an admin for the group involved
            */
            /*
            	create a new discussion forum without a default msg
            	if one isn't already there
            */
            $new_id = forum_create_forum($sys_news_group, $summary, 1, 0);
            $sql = "INSERT INTO news_bytes (group_id,submitted_by,is_approved,date,forum_id,summary,details) " . " VALUES ('{$group_id}','" . user_getid() . "','0','" . time() . "','{$new_id}','" . htmlspecialchars($summary) . "','" . htmlspecialchars($details) . "')";
            $result = db_query($sql);
开发者ID:BackupTheBerlios,项目名称:berlios,代码行数:30,代码来源:submit.php


示例12: getIntFromRequest

 */
require_once '../env.inc.php';
require_once $gfwww . 'include/pre.php';
require_once $gfwww . 'include/note.php';
require_once $gfwww . 'news/news_utils.php';
require_once $gfcommon . 'forum/Forum.class.php';
require_once $gfcommon . 'include/TextSanitizer.class.php';
// to make the HTML input by the user safe to store
$group_id = getIntFromRequest('group_id');
if (session_loggedin()) {
    if (!user_ismember($group_id, 'A')) {
        exit_permission_denied(_('You cannot submit news for a project unless you are an admin on that project'));
    }
    $group_id = getIntFromRequest('group_id');
    if ($group_id == $sys_news_group) {
        exit_permission_denied(_('Submitting news from the news group is not allowed.'));
    }
    if (getStringFromRequest('post_changes')) {
        if (!form_key_is_valid(getStringFromRequest('form_key'))) {
            exit_form_double_submit();
        }
        $summary = getStringFromRequest('summary');
        $details = getStringFromRequest('details');
        //check to make sure both fields are there
        if ($summary && $details) {
            /*
            	Insert the row into the db if it's a generic message
            	OR this person is an admin for the group involved
            */
            /*
            	create a new discussion forum without a default msg
开发者ID:neymanna,项目名称:fusionforge,代码行数:31,代码来源:submit.php


示例13: project_admin_header

function project_admin_header($params)
{
    global $group_id, $feedback, $HTML;
    $params['toptab'] = 'admin';
    $params['group'] = $group_id;
    $project =& group_get_object($group_id);
    if (!$project || !is_object($project)) {
        return;
    }
    $perm =& $project->getPermission(session_get_user());
    if (!$perm || !is_object($perm)) {
        return;
    }
    /*
    	Enforce Project Admin Perms
    */
    if (!$perm->isAdmin()) {
        exit_permission_denied();
    }
    site_project_header($params);
    $labels = array();
    $links = array();
    //$labels[] = _('Admin');
    $labels[] = _('Edit Public Info');
    $labels[] = _('Project History');
    if ($GLOBALS['sys_use_people']) {
        $labels[] = _('Post Jobs');
        $labels[] = _('Edit Jobs');
    }
    if ($GLOBALS['sys_use_project_multimedia']) {
        $labels[] = _('Edit Multimedia Data');
    }
    if ($GLOBALS['sys_use_project_vhost']) {
        $labels[] = _('VHOSTs');
    }
    if ($GLOBALS['sys_use_project_database']) {
        $labels[] = _('Database Admin');
    }
    $labels[] = _('Stats');
    plugin_hook("quota_label_project_admin");
    //$links[] = '/project/admin/?group_id='.$group_id;
    $links[] = '/project/admin/editgroupinfo.php?group_id=' . $group_id;
    $links[] = '/project/admin/history.php?group_id=' . $group_id;
    if ($GLOBALS['sys_use_people']) {
        $links[] = '/people/createjob.php?group_id=' . $group_id;
        $links[] = '/people/?group_id=' . $group_id;
    }
    if ($GLOBALS['sys_use_project_multimedia']) {
        $links[] = '/project/admin/editimages.php?group_id=' . $group_id;
    }
    if ($GLOBALS['sys_use_project_vhost']) {
        $links[] = '/project/admin/vhost.php?group_id=' . $group_id;
    }
    if ($GLOBALS['sys_use_project_database']) {
        $links[] = '/project/admin/database.php?group_id=' . $group_id;
    }
    $links[] = '/project/stats/?group_id=' . $group_id;
    plugin_hook("quota_link_project_admin");
    echo $HTML->beginSubMenu();
    echo $HTML->printSubMenu($labels, $links);
    plugin_hook("groupadminmenu", $params);
    echo $HTML->endSubMenu();
}
开发者ID:neymanna,项目名称:fusionforge,代码行数:63,代码来源:project_admin_utils.php


示例14: updateArtifact

 function updateArtifact($row, $data, $aid, &$errors, $notify = false)
 {
     global $Language;
     $ah = new Tracker_Html($this->ath, $aid);
     if (!$ah || !is_object($ah)) {
         exit_error($Language->getText('global', 'error'), $Language->getText('plugin_tracker_index', 'not_create_art'));
     } else {
         if ($ah->isError()) {
             exit_error($Language->getText('global', 'error'), $ah->getErrorMessage());
         } else {
             // Check if users can update anonymously
             if (!user_isloggedin() && !$this->ath->allowsAnon()) {
                 exit_not_logged_in();
             }
             if (!$ah->Tracker->userIsAdmin()) {
                 exit_permission_denied();
                 return;
             }
             $vfl = $this->prepareVfl($data, $artifact_depend_id, $add_cc, $cc_comment, $comments);
             //data control layer
             if (!$ah->handleUpdate($artifact_depend_id, 100, $changes, false, $vfl, true)) {
                 exit_error($Language->getText('global', 'error'), '');
             }
             if ($add_cc) {
                 if (!$ah->updateCC($add_cc, $cc_comment)) {
                     $errors .= $Language->getText('plugin_tracker_import_utils', 'problem_add_cc', $ah->getID()) . " ";
                 }
             }
             $comments_ok = false;
             if ($comments) {
                 if ($this->parseFollowUpComments($comments, $parsed_comments, $aid) && $parsed_comments && !empty($parsed_comments)) {
                     $comments_ok = true;
                     if (!$ah->addFollowUpComments($parsed_comments)) {
                         $errors .= $Language->getText('plugin_tracker_import_utils', 'problem_insert_followup', $ah->getID()) . " ";
                         $comments_ok = false;
                         return false;
                     }
                 } else {
                     return false;
                 }
             }
             if ($notify && (count($changes) > 0 || $add_cc || $comments_ok)) {
                 $agnf = new Tracker_NotificationsManager($this->ath);
                 $ah->mailFollowupWithPermissions($agnf->getAllAddresses($this->ath->getID(), $update = true), $changes);
             }
             if (count($changes) > 0 || $add_cc || $comments_ok) {
                 // Update the 'last_update_date' artifact field
                 $res_last_up = $ah->update_last_update_date();
             }
         }
     }
     return true;
 }
开发者ID:nterray,项目名称:tuleap,代码行数:53,代码来源:Tracker_Import.class.php


示例15: handleUpdate

 /**
  *  Update an artifact. Rk: vfl is an variable list of fields, Vary from one project to another
  *  return true if artifact updated, false if nothing changed or DB update failed
  *
  * @param artifact_id_dependent: artifact dependencies
  * @param canned_response: canned responses
  * @param changes (OUT): array of changes (for notifications)
  *
  *  @return boolean
  */
 function handleUpdate($artifact_id_dependent, $canned_response, &$changes, $masschange = false, $vfl = false, $import = false)
 {
     global $art_field_fact, $HTTP_POST_VARS, $Language;
     if ($masschange && !$this->ArtifactType->userIsAdmin()) {
         exit_permission_denied();
     }
     if (!$import) {
         // Retrieve HTTP GET variables and store them in $vfl array
         $vfl = $art_field_fact->extractFieldList();
         // make sure  required fields are not empty
         if ($art_field_fact->checkEmptyFields($vfl) == false) {
             exit_missing_param();
         }
     }
     //get this artifact from the db
     $result = $this->getFieldsValues();
     //
     //  See which fields changed during the modification
     //  and if we must keep history then do it. Also add them to the update
     //  statement
     //
     $reference_manager =& ReferenceManager::instance();
     $text_value_list = array();
     $changes = array();
     $upd_list = '';
     reset($vfl);
     while (list($field_name, $value) = each($vfl)) {
         $field = $art_field_fact->getFieldFromName($field_name);
         // skip over special fields  except for details which in this
         // particular case can be processed normally
         if ($field->isSpecial()) {
             continue;
         }
         if ($field->isInt() && $value == '' && $field->getRequired() == 0) {
             $value = 0;
         }
         // we check if the given value is authorized for this field (for select box fields only)
         // we don't check here the none value, we have already check it before (we can't check here the none value because the function checkValueInPredefinedValues don't take the none value into account)
         // if the value did not change, we don't do the check (because of stored values that can be deleted now)
         if (!$masschange && $result[$field_name] != $value && $field->isSelectBox() && $value != 100 && !$field->checkValueInPredefinedValues($this->ArtifactType->getID(), $value)) {
             $this->setError($Language->getText('tracker_common_artifact', 'bad_field_value', array($field->getLabel(), $value)));
             return false;
         }
         if (!$masschange && $field->isMultiSelectBox()) {
             if (is_array($value)) {
                 foreach ($value as $a_value) {
                     if ($a_value != 100 && !$field->checkValueInPredefinedValues($this->ArtifactType->getID(), $a_value)) {
                         $this->setError($Language->getText('tracker_common_artifact', 'bad_field_value', array($field->getLabel(), $value)));
                         return false;
                     }
                 }
             }
         }
         $is_text = $field->isTextField() || $field->isTextArea();
         if ($field->isMultiSelectBox() && is_array($value)) {
             if ($masschange && in_array($Language->getText('global', 'unchanged'), $value)) {
                 continue;
             }
             // The field is a multi values field and it has multi assigned values
             $values = $value;
             // check if the user can update the field or not
             if (!$field->userCanUpdate($this->ArtifactType->getGroupID(), $this->ArtifactType->getID(), user_getid())) {
                 // we only throw an error if the values has changed
                 $old_values = $field->getValues($this->getID());
                 list($deleted_values, $added_values) = util_double_diff_array($old_values, $values);
                 if (count($deleted_values) > 0 || count($added_values) > 0) {
                     // The user does not have the permissions to update the current field,
                     // we exit the function with an error message
                     $this->setError($Language->getText('tracker_common_artifact', 'bad_field_permission_update', $field->getLabel()));
                     return false;
                 }
             }
             //don't take into account the none value if there are several values selected
             if (count($values) > 1) {
                 $temp = array();
                 while (list($i, $v) = each($values)) {
                     if ($v == 100) {
                         unset($values[$i]);
                         $unset = true;
                     } else {
                         $temp[] = $v;
                     }
                 }
                 if (isset($unset) && $unset) {
                     $values = $temp;
                 }
             }
             $old_values = $field->getValues($this->getID());
             list($deleted_values, $added_values) = util_double_diff_array($old_values, $values);
             // Check if there are some differences
//.........这里部分代码省略.........
开发者ID:nterray,项目名称:tuleap,代码行数:101,代码来源:Artifact.class.php


示例16: pm_footer

		</td>
	</tr>
	</table>
	</form>
	<?php 
        pm_footer(array());
    } else {
        if ($delete && $group_project_id) {
            $pg = new ProjectGroup($g, $group_project_id);
            if (!$pg || !is_object($pg)) {
                exit_error('Error', 'Could Not Get ProjectGroup');
            } elseif ($pg->isError()) {
                exit_error('Error', $pg->getErrorMessage());
            }
            if (!$pg->userIsAdmin()) {
                exit_permission_denied();
            }
            pm_header(array('title' => _('Delete')));
            ?>
	<form action="<?php 
            echo getStringFromServer('PHP_SELF') . '?group_id=' . $group_id . '&amp;group_project_id=' . $group_project_id;
            ?>
" method="post">
	<input type="hidden" name="post_changes" value="y" />
	<input type="hidden" name="delete" value="y" /><br />
	<?php 
            echo _('You are about to permanently and irretrievably delete this subproject and all its related data!');
            ?>
	<p>
	<input type="checkbox" name="sure" value="1"><?php 
            echo _('I\'m Sure');
开发者ID:neymanna,项目名称:fusionforge,代码行数:31,代码来源:index.php


示例17: tracker_graphic_report_admin

 /**
  * Hook: Tracker admin "controller"
  * 
  * @param $params
  * 
  * @return void
  */
 function tracker_graphic_report_admin($params)
 {
     $request = HTTPRequest::instance();
     if ($request->getValidated('func', 'string') != 'date_field_notification') {
         return;
     }
     if (!user_isloggedin()) {
         exit_not_logged_in();
         return;
     }
     if (!$params['ath']->userIsAdmin()) {
         exit_permission_denied();
         return;
     }
     $field_id = $request->getValidated('field_id', 'uint');
     $field = $params['art_field_fact']->getFieldFromId($field_id);
     if ($field && $field->isDateField() && !$field->isSpecial()) {
         if ($request->isPost()) {
             if ($request->existAndNonEmpty('delete_reminder')) {
                 $tdrArtifactField = new TrackerDateReminder_ArtifactField();
                 $tdrArtifactField->deleteFieldReminderSettings($field->getID(), $params['ath']->getID());
             } elseif (array_key_exists('submit_notif_settings', $_REQUEST) && $_REQUEST['submit_notif_settings']) {
                 if ((!isset($_REQUEST['notified_users']) || isset($_REQUEST['notified_users']) && $_REQUEST['notified_users'] == NULL) && _(!isset($_REQUEST['notified_groups']) || isset($_REQUEST['notified_groups']) && $_REQUEST['notified_groups'] == NULL)) {
                     $GLOBALS['Response']->addFeedback('error', $GLOBALS['Language']->getText('plugin_tracker_date_reminder', 'specify_notified_users'));
                 } else {
                     if (count($_REQUEST['notified_users']) == 1 && $_REQUEST['notified_users'][0] == 100 && count($_REQUEST['notified_groups']) == 1 && $_REQUEST['notified_groups'][0] == 100) {
                         $GLOBALS['Response']->addFeedback('error', $GLOBALS['Language']->getText('plugin_tracker_date_reminder', 'specify_notified_users'));
                     } else {
                         if (!isset($_REQUEST['start']) || isset($_REQUEST['start']) && $_REQUEST['start'] == NULL) {
                             $GLOBALS['Response']->addFeedback('error', $GLOBALS['Language']->getText('plugin_tracker_date_reminder', 'specify_notification_start'));
                         } else {
                             if (!ereg("^[0-9]+\$", $_REQUEST['start']) || $_REQUEST['start'] < 0) {
                                 $GLOBALS['Response']->addFeedback('error', $GLOBALS['Language']->getText('plugin_tracker_date_reminder', 'positive_value'));
                             } else {
                                 if (!isset($_REQUEST['frequency']) || isset($_REQUEST['frequency']) && ($_REQUEST['frequency'] == NULL || $_REQUEST['frequency'] == 0)) {
                                     $GLOBALS['Response']->addFeedback('error', $GLOBALS['Language']->getText('plugin_tracker_date_reminder', 'specify_notification_frequency'));
                                 } else {
                                     if (!ereg("^[0-9]+\$", $_REQUEST['frequency']) || $_REQUEST['frequency'] < 0) {
                                         $GLOBALS['Response']->addFeedback('error', $GLOBALS['Language']->getText('plugin_tracker_date_reminder', 'positive_value'));
                                     } else {
                                         if (!isset($_REQUEST['recurse']) || isset($_REQUEST['recurse']) && ($_REQUEST['recurse'] == NULL || $_REQUEST['recurse'] == 0)) {
                                             $GLOBALS['Response']->addFeedback('error', $GLOBALS['Language']->getText('plugin_tracker_date_reminder', 'specify_notification_recurse'));
                                         } else {
                                             if (!ereg("^[0-9]+\$", $_REQUEST['recurse']) || $_REQUEST['recurse'] < 0) {
                                                 $GLOBALS['Response']->addFeedback('error', $GLOBALS['Language']->getText('plugin_tracker_date_reminder', 'positive_value'));
                                             } else {
                                                 //merge notified_users and notified_groups into one array
                                                 $notified = array();
                                                 if (isset($_REQUEST['notified_users'])) {
                                                     foreach ($_REQUEST['notified_users'] as $u) {
                                                         if ($u != 100) {
                                                             $notified[] = $u;
                                                         }
                                                     }
                                                 }
                                                 if (isset($_REQUEST['notified_groups'])) {
                                                     foreach ($_REQUEST['notified_groups'] as $gr) {
                                                         if ($gr != 100) {
                                                             $notified[] = $gr;
                                                         }
                                                     }
                                                 }
                                                 // now update the reminder settings
                                                 $tdrArtifactField = new TrackerDateReminder_ArtifactField();
                                                 $res = $tdrArtifactField->updateDateFieldReminderSettings($params['ath'], $field, $params['ath']->getID(), $_REQUEST['start'], $_REQUEST['notif_type'], $_REQUEST['frequency'], $_REQUEST['recurse'], $notified);
                                                 if ($res) {
                                                     $GLOBALS['Response']->addFeedback('info', $GLOBALS['Language']->getText('plugin_tracker_date_reminder', 'notif_update_success', array($field->getLabel())));
                                                 } else {
                                                     $GLOBALS['Response']->addFeedback('error', $GLOBALS['Language']->getText('plugin_tracker_date_reminder', 'notif_update_fail', array($field->getLabel())));
                                                 }
                                             }
                                         }
                                     }
                                 }
                             }
                         }
                     }
                 }
             }
         }
         $params['ath']->adminHeader(array('title' => $GLOBALS['Language']->getText('plugin_tracker_date_reminder', 'admin_date_field_notif'), 'help' => 'tracker.html#email-notification-settings'));
         echo '<H2>' . $GLOBALS['Language']->getText('tracker_import_admin', 'tracker') . ' \'<a href="/tracker/admin/?group_id=' . $params['ath']->Group->getID() . '&atid=' . $params['ath']->getID() . '">' . $params['ath']->getName() . '</a>\' - ' . $GLOBALS['Language']->getText('tracker_include_type', 'mail_notif') . '</h2>';
         $tdrArtifactFieldHtml = new TrackerDateReminder_ArtifactFieldHtml();
         $tdrArtifactFieldHtml->displayDateFieldNotificationSettings($params['ath'], $field);
         $params['ath']->footer(array());
         exit;
     }
 }
开发者ID:pombredanne,项目名称:tuleap,代码行数:95,代码来源:tracker_date_reminderPlugin.class.php



注:本文中的exit_permission_denied函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
PHP exit_with_error函数代码示例发布时间:2022-05-15
下一篇:
PHP exit_not_logged_in函数代码示例发布时间: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