當前位置: 首頁>>代碼示例>>PHP>>正文


PHP global_common::isAdmin方法代碼示例

本文整理匯總了PHP中global_common::isAdmin方法的典型用法代碼示例。如果您正苦於以下問題:PHP global_common::isAdmin方法的具體用法?PHP global_common::isAdmin怎麽用?PHP global_common::isAdmin使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在global_common的用法示例。


在下文中一共展示了global_common::isAdmin方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: array

        $result = $objUser->setRoleAdmin($userID, $isAdmin);
        if ($result) {
            $arrHeader = global_common::getMessageHeaderArr($banCode);
            //$banCode
            echo global_common::convertToXML($arrHeader, array("rs", "inf"), array(1, 'Update successfully'), array(0, 1));
            return;
        } else {
            echo global_common::convertToXML($arrHeader, array("rs", "inf"), array(0, 'Update failed'), array(0, 1));
            return;
        }
    } else {
        echo global_common::convertToXML($arrHeader, array("rs", "inf"), array(0, 'Update failed. You have no permision to perform this'), array(0, 1));
        return;
    }
} elseif ($_pgR['act'] == Model_User::ACT_SET_PASWORD) {
    if (global_common::isAdmin()) {
        $userID = $_pgR[global_mapping::UserID];
        $password = $_pgR[global_mapping::Password];
        $confirmedPassword = $_pgR['ConfirmedPassword'];
        if ($password == $confirmedPassword) {
            $result = $objUser->changeResetPassword($userID, $password);
            if ($result) {
                $arrHeader = global_common::getMessageHeaderArr($banCode);
                //$banCode
                echo global_common::convertToXML($arrHeader, array("rs", "inf"), array(1, 'Update successfully'), array(0, 1));
                return;
            } else {
                echo global_common::convertToXML($arrHeader, array("rs", "inf"), array(0, 'Update failed'), array(0, 1));
                return;
            }
        } else {
開發者ID:vietlethanh,項目名稱:oceo,代碼行數:31,代碼來源:admin_user.php

示例2: array

            echo global_common::convertToXML($arrHeader, array("rs", "inf"), array(1, ($statusID == global_common::STATUS_ACTIVE ? 'Bán lại' : 'Dừng bán') . ' thành công'), array(0, 1));
            return;
        } else {
            echo global_common::convertToXML($arrHeader, array("rs", "inf"), array(0, ($isActivate ? 'Xóa' : 'Deactivate') . ' unsuccessfully'), array(0, 1));
            return;
        }
    }
    return;
} elseif ($_pgR['act'] == Model_Product::ACT_ACTIVE_PRODUCT) {
    if (global_common::isCLogin()) {
        $productID = $_pgR['id'];
        $statusID = $_pgR['statusid'];
        $currentUserID = $_SESSION[global_common::SES_C_USERINFO][global_mapping::UserID];
        $product = $objProduct->getProductByID($productID);
        $createBy = $product[global_mapping::CreatedBy];
        if ($createBy != $currentUserID && global_common::isAdmin() == false) {
            return;
        }
        $result = global_common::updateDeleteFlag($productID, global_mapping::ProductID, $currentUserID, Model_Product::TBL_SL_PRODUCT, $statusID, $objConnection);
        if ($result) {
            $arrHeader = global_common::getMessageHeaderArr($banCode);
            //$banCode
            echo global_common::convertToXML($arrHeader, array("rs", "inf"), array(1, ($statusID == global_common::STATUS_ACTIVE ? 'Phục hồi' : 'Xóa') . ' thành công'), array(0, 1));
            return;
        } else {
            echo global_common::convertToXML($arrHeader, array("rs", "inf"), array(0, ($isActivate ? 'Xóa' : 'Bán lại') . ' không thành công'), array(0, 1));
            return;
        }
    }
    return;
} elseif ($_pgR['act'] == Model_Product::ACT_CLONE) {
開發者ID:vietlethanh,項目名稱:oceo,代碼行數:31,代碼來源:bg_product.php

示例3: getCommentHTMLByArticle

 public function getCommentHTMLByArticle($articleID, $page)
 {
     if (!$page) {
         $page = 1;
     }
     $comments = $this->getCommentByArticle($articleID, $page, '*', '', 'ModifiedDate Desc');
     $condition = ' where `' . global_mapping::ArticleID . '` =  \'' . $articleID . '\'  AND CommentID NOT IN (SELECT CommentID FROM sl_comment_bad WHERE `STATUS` =\'1\')';
     $total = global_common::getTotalRecord(Model_Comment::TBL_SL_COMMENT, $this->_objConnection, $condition);
     $commentHTML = '';
     foreach ($comments as $item) {
         $commentHTML .= '<div class="item">';
         $commentHTML .= '		<div class="avatar">';
         $commentHTML .= '			<img src="' . $item[global_mapping::CreatedBy][global_mapping::Avatar] . '" />';
         $commentHTML .= '		</div>';
         $commentHTML .= '		<div class="comment-detail">';
         $commentHTML .= '			<div class="username">';
         $commentHTML .= '				 <a href="#">' . $item[global_mapping::CreatedBy][global_mapping::FullName] . '</a>	';
         $commentHTML .= '				 <p class="created-date">' . global_common::formatDateTimeVN($item[global_mapping::CreatedDate]) . '</p>	';
         $commentHTML .= '			</div>';
         $commentHTML .= '			<div class="comment-detail-content">';
         $commentHTML .= '					' . $item[global_mapping::Content];
         $commentHTML .= '			</div>	';
         if (global_common::isAdmin()) {
             $commentHTML .= '		<div class="comment-controls">';
             $commentHTML .= '			<a href="javascript:comment.badComment(\'' . $item[global_mapping::CommentID] . '\',1)">Delete</a>';
             $commentHTML .= '		</div>	';
         }
         $commentHTML .= '		</div>';
         $commentHTML .= '</div>';
     }
     $commentHTML .= global_common::getPagingHTMLByNum($page, Model_Comment::NUM_PER_PAGE, $total, 'comment.changePage');
     return $commentHTML;
 }
開發者ID:vietlethanh,項目名稱:oceo,代碼行數:33,代碼來源:model_comment.php


注:本文中的global_common::isAdmin方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。