Exemple #1
0
 public function setRights($userID, $rightLevel){
     logger_FuncCall(__FILE__, __LINE__, __FUNCTION__);
     if (!is_numeric($userID)){ throw new InvalidParamException(0, _T::NUMBER); }
     if (!is_numeric($rightLevel)){ throw new InvalidParamException(0, _T::NUMBER); }
     if (!_FCORE::ValidateNumeric($rightLevel, 0, 3)){ throw new InvalidValueException('$rightLevel'); }
     if ($rightLevel == 0){
         return $this->dbRef->Delete(
             PAGERIGHTS,
             PAGERIGHTS_PAGEID."=$this->pageID AND ".PAGERIGHTS_USERID."=$userID");
     } else {
         if ($this->dbRef->DoesRecordExist(
                 PAGERIGHTS,
                 PAGERIGHTS_PAGEID."=$this->pageID AND ".PAGERIGHTS_USERID."=$userID")){
             return $this->dbRef->Update(
                     PAGERIGHTS,
                     PAGERIGHTS_USERRIGHT."=$rightLevel",
                     PAGERIGHTS_PAGEID."=$this->pageID AND ".PAGERIGHTS_USERID."=$userID");
         } else {
             return $this->dbRef->Insert(
                     PAGERIGHTS,
                     PAGERIGHTS_PAGEID."=$this->pageID, ".PAGERIGHTS_USERID."=$userID, ".PAGERIGHTS_USERRIGHT."=$rightLevel");
         }
     }
 }
Exemple #2
0
 /**
  * checks the login password, returns false if failed. sets $_SESSION['validated']
  * if successful
  * @param <string> $passAttempt
  * @param <string> $salt
  * @param <string> $password
  * @return <boolean>
  */
 public static final function CheckLoginAttempt($passAttempt, $salt, $password){
     if ($password != _FCORE::GetSecondOrderHash($passAttempt, $salt)){
         return false;
     }
     $_SESSION['validated'] = 1;
     return true;
 }
Exemple #3
0
    public function EchoBaseLayout(){
        logger_FuncCall(__FILE__, __LINE__, __FUNCTION__);
        ?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
    <title>Boyd's Nest</title>
    <?php echo _FCORE::CSSInclude(URL_STYLE_BASESTYLE); ?>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" />

<!-- Begin This Page Style -->
    <?php $this->thisPageStyle(); ?>

<!-- End Section -->

</head>
<body>


<!-- Begin Header Menu Layout -->

    <div id="_headercontainer">
        <div id="_hc_upper">
            <a href="<?php echo URL_PAGE_INDEX; ?>">
                BOYDS NEST
            </a>
        </div>
        <div id="_hc_menu">
            <ul>
                <li><a href="<?php echo URL_PAGE_HOME; ?>">HOME</a></li>
                <li><a href="<?php echo URL_PAGE_ADMIN; ?>">ADMIN</a></li>
                <li><a href="<?php echo URL_PAGE_TERMS; ?>">TERMS</a></li>
                <li><a href="<?php echo URL_PAGE_CONTACTUS; ?>">CONTACT US</a></li>
                <li><a href="<?php echo URL_PAGE_USERMANUAL; ?>">USER MANUAL</a></li>
                <?php if(_S::IsLoggedIn()) { ?>
                <li><a href="<?php echo URL_PAGE_LOGOUT; ?>">LOGOUT</a></li>
                <?php } else { ?>
                <li><a href="<?php echo URL_PAGE_LOGIN; ?>">LOGIN</a></li>
                <?php } ?>
            </ul>
        </div>
    </div>

<!-- End Section -->

    <div id="_pagecontent">

<!-- Begin This Page Content -->
        <?php $this->thisPageLayout(); ?>

<!-- End Section -->

    </div>


<!-- Begin Footer Layout -->

    <div id="_footercontent">
        This Site Is Owned By The Boyd's Family, And Was Created By R And L
    </div>

<!-- End Section -->


</body>
</html>
        <?php
    }
Exemple #4
0
        if ($userID){
            if (($userID == _SESSION::GetUserID() && _SESSION::GetCanCDSelf()) ||
                ($userID != _SESSION::GetUserID() && _SESSION::GetCanCDOther())){
                $db = _DB::_Connect();
                echo MakeCreateUserChildOfSelect(
                    DB_PAGE::_GetPageListForUserID($db, $userID));
                $db->disconnect();
            } else {
                echo "Access Denied";
            }
        } else {
            echo "Invalid Param";
        }
        break;
    case "admin_pagesmanage":
        $userID = _FCORE::IsSetPostDefault(PAGES_USERID, false);
        if ($userID){
            if (($userID == _SESSION::GetUserID() && _SESSION::GetCanCDSelf()) ||
                ($userID != _SESSION::GetUserID() && _SESSION::GetCanCDOther())){
                $db = _DB::_Connect();

                $bypase = ($userID == _SESSION::GetUserID() || _SESSION::GetDefaultRight() > 0);
                $arr = $bypase ? DB_USER::_GetAllPageRightsForUser($db, $userID) : array();
                $forum = ThreadedForumBuilder::MakeFolderHierarchyForUser(
                        DB_PAGE::_GetPageListForUserID($db, $userID),
                        $arr,
                        1,
                        $bypase);

                echo ThreadedForumViewer::BuildViewForAdminPageManage($forum,
                        $userID == _SESSION::GetUserID() ?
Exemple #5
0
                                $first = false;
                            } else {
                                $returning .= "::::";
                            }
                            $returning .=
                                $pages[$i]->getPageID()."::".
                                $pages[$i]->getTitle()."::".
                                ($pages[$i]->getHasChildren()>0 ? "1" : "0");
                        }
                    }
                    echo $returning;
                    $db->disconnect();
                }
                break;
            case "getpage":
                $pageID = (int)_FCORE::IsSetPostDefault(PAGES_PAGEID, false);
                if ($pageID){
                    $db = _DB::_Connect();
                    if (_SESSION::GetCanViewPage($db, $pageID)){
                        try {
                            $page = DB_PAGE::_GetPage($db, $pageID);
                            echo $page->getPageID()."::::".$page->getTitle()."::::".$page->getContentAsHTML();
                        } catch(Exception $e) { }
                    }
                    $db->disconnect();
                }
                break;
        }
    }
}
Exemple #6
0
protected function thisPagePreProcessing() {
        $db = _DB::_Connect();
        $action = _FCORE::IsSetPOST(ACTION_GO);
        if ($action == ACTION_UPDATE) {
            $submitvalue = _FCORE::IsSetPOST("submitvalue");
            if ($submitvalue == "Update") {
    $pageID = _FCORE::IsSetPOST(USERMANUAL_PAGEID);
    $pageTitle = _FCORE::IsSetPOST(USERMANUAL_TITLE);
    $pageRank = _FCORE::IsSetPOST(USERMANUAL_RANK);
    if ($pageID != null && $pageTitle != null && $pageRank != null) {
        $page = DB_USERMANUAL::_GetUserManualPage($db, $pageID);
        $page->setRank($pageRank);
        $page->setTitle($pageTitle);
    }
            } else if ($submitvalue == "Delete") {
    $pageID = _FCORE::IsSetPOST(USERMANUAL_PAGEID);
    if ($pageID) {
        DB_USERMANUAL::_DeleteUserManualPage($db, $pageID);
    }
            }
        } else if ($action == ACTION_CREATE) {
            $rank = _FCORE::IsSetPOST(USERMANUAL_RANK);
            $title = _FCORE::IsSetPOST(USERMANUAL_TITLE);
            if ($rank != null && $title != null) {
    DB_USERMANUAL::_CreateUserManualPage($db, "", $title, $rank);
            }
        }
        $this->crossInfo[_USERMANUAL::PAGELIST] = DB_USERMANUAL::_GetTitleList($db);
        $db->disconnect();
    }
Exemple #7
0
    protected function thisPagePreProcessing(){
        $this->crossInfo[_HOMEPAGE::DATABASE] = false;
        $this->crossInfo[_HOMEPAGE::MENULIST] = _FCORE::IsSetPostDefault(_HOMEPAGE::MENULIST, false);
        if (!$this->crossInfo[_HOMEPAGE::MENULIST]){
            $this->crossInfo[_HOMEPAGE::DATABASE] = _DB::_Connect();
            $this->crossInfo[_HOMEPAGE::MAINVIEW_USERID] =
                    _SESSION::GetIsFamily() ? _SESSION::GetUserID() : false;

            $this->crossInfo[_HOMEPAGE::MENULIST] = array();
            if ($this->crossInfo[_HOMEPAGE::MAINVIEW_USERID]){
                 $raw = DB_PAGE::_GetUserRoots(
                        $this->crossInfo[_HOMEPAGE::DATABASE],
                        $this->crossInfo[_HOMEPAGE::MAINVIEW_USERID]);
                 $this->crossInfo[_HOMEPAGE::MENULIST] = new _FORUM();
                 $this->crossInfo[_HOMEPAGE::MENULIST]->placeNodeArray($raw);
            }

            $this->crossInfo[_HOMEPAGE::FAMILYLIST] = DB_USER::_GetFamilyOnlyUserList($this->crossInfo[_HOMEPAGE::DATABASE]);
        }
        $this->absolutePreProcessing();
    }
Exemple #8
0
 public function absolutePreProcessing(){
     $db = _DB::_Connect();
     $action = _FCORE::IsSetPostDefault(ACTION_GO, false);
     if ($action){
         $logID = _FCORE::IsSetPostDefault(LOGINLOG_LOGID, false);
         if ($logID){
             try {
                 DB_LOGINLOG::_DeleteLoginLog($db, $logID);
                 $this->crossInfo[RESULTS] = "Successfully Deleted Log";
             }catch(Exception $e){
                 $this->crossInfo[RESULTS] = "Failed To Delete Log";
             }
         }
     }
     $this->crossInfo[_ADMINPAGE::LOGIN_LOGS_START] = _FCORE::IsSetGetDefault(_ADMINPAGE::LOGIN_LOGS_START, 0);
     $this->crossInfo[_ADMINPAGE::LOGIN_LOGS_AMOUNT] = _FCORE::IsSetGetDefault(_ADMINPAGE::LOGIN_LOGS_AMOUNT, 50);
     $this->crossInfo[_ADMINPAGE::LOGIN_LOGS] = DB_LOGINLOG::_GetLoginLogList($db,
             $this->crossInfo[_ADMINPAGE::LOGIN_LOGS_START],
             $this->crossInfo[_ADMINPAGE::LOGIN_LOGS_AMOUNT]);
     $db->disconnect();
 }
Exemple #9
0
        ?>
<div id="text">
    Access Denied
</div>
        <?php
    }
    protected function thisPageStyle(){
    }
    protected function thisPagePreProcessing(){
    }
    public function trigger($data = null){
        $this->EchoBaseLayout();
    }
}

$thiserror = _FCORE::IsSetGetDefault(ERROR_PAGE, false);
if ($thiserror){
    switch($thiserror){
        case ERROR_UNEXPECTEDERROR:
            $thiserror = new error_UnexpectedError();
            break;
        case ERROR_MUSTBELOGGEDIN:
            $thiserror = new error_MustBeLoggedIn();
            break;
        case ERROR_ACCESSDENIED:
            $thiserror = new error_AccessDenied();
            break;
        case ERROR_UNDERCONSTRUCTION:
            $thiserror = new error_UnderConstruction();
            break;
        case ERROR_UNKNOWNACTION: