Exemple #1
0
 public function read($key)
 {
     crunch($key);
     if ($this->set($key)) {
         return $this->cache[$key];
     } else {
         exLog("Configuration->read(): {$key} does not exist");
     }
 }
Exemple #2
0
 public function __set($key, $value)
 {
     $valid_update = array('username' => 'username', 'fname' => 'first_name', 'mname' => 'middle_name', 'lname' => 'last_name', 'dname' => 'display_name', 'email' => 'email', 'type' => 'type', 'role' => 'role', 'banned' => 'banned');
     if (in_array($key, $valid_update)) {
         array_flip($valid_update);
         $this->{$key} = $value;
         $this->needs_update[$key] = $value;
     } else {
         exLog("User->__set(): {$key} does not allow modifications.");
     }
 }
Exemple #3
0
 public function __construct()
 {
     $args = eoargs(func_get_args());
     $this->read_only = false;
     if (isset($args['clone'])) {
         $_page = new Page($args['clone']);
         if (!is_null($_page->id)) {
             $this->id = $_page->id;
             $this->name = $_page->name;
             $this->content = $_page->content;
             $this->author = $_page->author;
         } else {
             exLog("BlankPage->__construct(): Failed to clone from id {$args['clone']}");
         }
     }
     $this->{$id} = appPagesGenerateKey();
     $this->name = $args['name'];
     $this->ref_name = crunch($args['name'], true);
     $this->content = $args['content'];
     if (is_string($args['author']) and strlen($args['author'] == 32)) {
         $args['author'] = new User($args['author']);
     }
     if (is_object($args['author']) and isset($args['author']->id)) {
         $this->author = $args['author'];
     }
     $this->date_modified = $this->date_created = date(sdfDay);
     $this->draft = priority_select($args['draft'], false);
     // Is this needed?
     $draft = $this->draft ? '1' : '0';
     query(SharedPage::$statements['create'], $this->id, $this->name, $this->ref_name, $this->content, $this->author->id, $this->date_modified, $this->date_created, $draft);
     $__this = query(SharedPage::$statements['is_page'], $this->id);
     if (is_resource($__this) and mysql_num_rows($__this) > 0) {
         $_this = mysql_fetch_assoc($__this);
         $this->ref_id = $_this['ref_id'];
     }
 }
Exemple #4
0
 public function requireReassert()
 {
     // Not implimented
     exLog('Authority->requireReassert(): Unsupport as of this build');
 }
Exemple #5
0
if (file_exists($app_path . 'Application.php')) {
    if (file_exists($app_path . 'Initialize.php')) {
        include $app_path . 'Initialize.php';
    }
    if (System::Authority()->verified) {
        if (file_exists($app_path . 'Info.php')) {
            include $app_path . 'Info.php';
            if (!is_null($application['name'])) {
                setTitle($application['name']);
            }
        }
        if (file_exists($app_path . 'Resources.php')) {
            include $app_path . 'Resources.php';
        }
        require_once $app_path . 'Application.php';
    } else {
        exLog('Authority->verified: false');
        error('Insufficent Privlidges', 'You do not have the required permission to view this page.');
    }
} else {
    exLog('Application Load Failed: ' . System::Application());
    error('Application Not Found', 'The requested application bundle was either not found, or invalid.');
}
add('<hr />');
// REMOVE ME
if (System::InterfaceHandler()->mannagedUI) {
    include System::InterfaceHandler()->interfaceFile();
}
echo Development::logDump();
// REMOVE ME
System::Terminate();
Exemple #6
0
 public function menu($input, $pre = null, $item = null, $post = null, $pre2 = null)
 {
     if ($input == 0 and is_string($input)) {
         crunch($input);
         $result = query();
         if (is_resource($result)) {
             if (mysql_num_rows($result) == 1) {
                 $menu = mysql_fetch_assoc($result);
             } else {
                 exLog("Interface->menu({$input} 'string'): No menu found");
             }
         } else {
             exLog("Interface->menu({$input} 'string'): Result was not mysql value");
         }
     } else {
         if (is_array($input)) {
             $navigation = $input;
         } else {
             $result = query();
             if (is_resource($result)) {
                 if (mysql_num_rows($result) == 1) {
                     $menu = mysql_fetch_assoc($result);
                 } else {
                     exLog("Interface->menu({$input} 'string'): No menu found");
                 }
             } else {
                 exLog("Interface->menu({$input} 'string'): Result was not mysql value");
             }
         }
     }
     if (!isset($navigation)) {
         $result = query();
         while ($row = mysql_fetch_assoc($result)) {
             $navigation[] = $row;
         }
     }
     if ($pre == 'return formated') {
         unset($pre);
         $pre = $pre2;
         $return = true;
     } else {
         if ($pre == 'return unformatted') {
             return $navigation;
         }
     }
     if (is_null($pre)) {
         $pre = $this->template('Menu Pre');
     }
     if (is_null($item)) {
         $item = $this->template('Menu Item');
     }
     if (is_null($post)) {
         $item = $this->template('Menu Post');
     }
     $output = $pre;
     foreach ($navigation as $item) {
         if ($item['name'] == '[SESSION_PORTAL]' and $item['link'] == '[SESSION_PORTAL]') {
             if (System::Authority()->verified) {
                 $link['name'] = 'Logout';
                 $link['link'] = 'ex://Users/Logout';
             } else {
                 $link['name'] = 'Login';
                 $link['link'] = 'ex://Users/Login';
             }
         }
         if ($item['link'] == '[HOME]') {
             $item['link'] = cfRead('Home Link');
         }
         if (is_null($item['link'])) {
             $item['link'] = 'javascript:;';
         }
         $link = $this->parseLink($item['link']);
         $current = $this->isCurrentPage($link) ? ' class="current" ' : null;
         $output .= sprintf($item, $link, $link['name'], $current);
     }
     $output .= $post;
     if ($return === true) {
         return $output;
     } else {
         echo $output;
     }
 }
Exemple #7
0
function mime_type($input)
{
    if (file_exists($input)) {
        $mime_types = cfRead('Mime Types');
        list($dir, $base, $ext, $file) = pathinfo($input);
        return isset($mime_types[$ext]) ? $mime_types[$ext] : 'application/octet-stream';
    } else {
        exLog("mime_type(): No file at {$input}.");
    }
}