当前位置: 首页>>代码示例>>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;未经允许,请勿转载。