Beispiel #1
0
 /**
  *
  */
 public function before()
 {
     parent::before();
     if ($this->request->action() == 'login' && Auth::is_logged_in()) {
         $this->go_home();
     }
 }
Beispiel #2
0
 public function before()
 {
     parent::before();
     if (file_exists(CMSPATH . FileSystem::normalize_path('media/js/i18n/' . I18n::lang() . '-message.js'))) {
         Assets::js('i18n', ADMIN_RESOURCES . 'js/i18n/' . I18n::lang() . '-message.js', 'global');
     }
     if ($this->request->action() != 'logout' and Auth::is_logged_in()) {
         $this->go_home();
     }
 }
Beispiel #3
0
 /**
  * Send response with error code.
  *
  * @param string $message
  * @throws HTTP_Exception
  */
 protected function _deny_access($message = null)
 {
     if (Auth::is_logged_in() || $this->request->is_ajax()) {
         if ($message === null) {
             $message = 'No tienes permisos para acceder a esta página';
         }
         throw HTTP_Exception::factory(403, $message);
     } else {
         throw HTTP_Exception::factory(401);
     }
 }
Beispiel #4
0
 /**
  * 
  * @param string $message
  * @throws HTTP_Exception
  */
 protected function _deny_access($message = NULL)
 {
     if (Auth::is_logged_in() or $this->request->is_ajax()) {
         if ($message === NULL) {
             $message = 'You don`t have permissions to acces this page';
         }
         // Forbidden
         throw HTTP_Exception::factory(403, $message);
     } else {
         // Unauthorized / Login Requied
         throw HTTP_Exception::factory(401);
     }
 }
Beispiel #5
0
 /**
  * 
  * @param type Model_Page_Front
  */
 private function _render(Model_Page_Front $page)
 {
     View::set_global('page_object', $page);
     View::set_global('page', $page);
     $this->_ctx->set_page($page);
     // If page needs login, redirect to login
     if ($page->needs_login() == Model_Page::LOGIN_REQUIRED) {
         Observer::notify('frontpage_login_required', $page);
         if (!Auth::is_logged_in()) {
             Flash::set('redirect', $page->url());
             $this->redirect(Route::get('user')->uri(array('action' => 'login')));
         }
     }
     Observer::notify('frontpage_found', $page);
     $this->_ctx->set_crumbs($page);
     $this->_ctx->build_crumbs();
     // Если установлен статус 404, то выводим страницу 404
     // Страницу 404 могут выкидывать также Виджеты
     if (Request::current()->is_initial() and $this->response->status() == 404) {
         $message = $this->_ctx->get('throw_message');
         $this->_ctx = NULL;
         if (!$message) {
             $message = 'Page not found';
         }
         Model_Page_Front::not_found($message);
     }
     $html = (string) $page->render_layout();
     // Если пользователь Администраторо или девелопер, в конец шаблона
     // добавляем View 'system/blocks/toolbar', в котором можно добавлять
     // собственный HTML, например панель администратора
     if (Auth::is_logged_in() and Auth::has_permissions(array('administrator', 'developer'))) {
         $inject_html = (string) View::factory('system/blocks/toolbar');
         // Insert system HTML before closed tag body
         $matches = preg_split('/(<\\/body>)/i', $html, -1, PREG_SPLIT_NO_EMPTY | PREG_SPLIT_DELIM_CAPTURE);
         if (count($matches) > 1) {
             /* assemble the HTML output back with the iframe code in it */
             $html = $matches[0] . $inject_html . $matches[1] . $matches[2];
         }
     }
     // Если в наcтройках выключен режим отладки, то выключить etag кеширование
     if (Config::get('site', 'debug') == Config::NO) {
         $this->check_cache(sha1($html));
         $this->response->headers('last-modified', date('r', strtotime($page->updated_on)));
     }
     $this->response->headers('Content-Type', $page->mime());
     if (Config::get('global', 'x_powered_header') == Config::YES) {
         $this->response->headers('X-Powered-CMS', CMS_NAME . '/' . CMS_VERSION);
     }
     $this->response->body($html);
 }
Beispiel #6
0
    /**
     * Print all XHTML headers
     * This function prints the HTML header code, CSS link, and JavaScript link
     *
     * DOCTYPE is XHTML 1.0 Transitional
     * @param none
     */
    function printHTMLHeader()
    {
        global $conf;
        global $languages;
        global $lang;
        global $charset;
        $path = $this->dir_path;
        echo "<?xml version=\"1.0\" encoding=\"{$charset}\"?" . ">\n";
        ?>
	<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
		"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
	<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="<?php 
        echo $languages[$lang][2];
        ?>
" lang="<?php 
        echo $languages[$lang][2];
        ?>
">
	<head>
	<title> Room Reservation System
	
	</title>
	<meta http-equiv="Content-Type" content="text/html; charset=<?php 
        echo $charset;
        ?>
" />
	<?php 
        if ((bool) $conf['app']['allowRss'] && Auth::is_logged_in()) {
            echo '<link rel="alternate" type="application/rss+xml" title="phpScheduleIt" href=" ' . CmnFns::getScriptURL() . '/rss.php?id=' . Auth::getCurrentID() . "\"/>\n";
        }
        ?>
	<link rel="shortcut icon" href="favicon.ico"/>
	<link rel="icon" href="favicon.ico"/>

	<style type="text/css">
	@import url(<?php 
        echo $path;
        ?>
jscalendar/calendar-blue-custom.css);
	@import url(<?php 
        echo $path;
        ?>
css.css);
	</style>

	</head>
	<body>
	<?php 
    }
Beispiel #7
0
 public function action_profile()
 {
     $id = $this->request->param('id');
     if (empty($id) and Auth::is_logged_in()) {
         $id = Auth::get_id();
     }
     $user = ORM::factory('user', $id);
     if (!$user->loaded()) {
         Messages::errors(__('User not found!'));
         $this->go();
     }
     $this->template->title = __(':user profile', array(':user' => $user->username));
     $this->breadcrumbs->add($this->template->title);
     $this->template_js_params['USER_ID'] = $user->id;
     $this->template->content = View::factory('users/profile', array('user' => $user, 'permissions' => $user->permissions_list()));
 }
Beispiel #8
0
 /**
  * 
  * @global type $table_name
  * @param array $fields
  * @param array $related_columns
  * @param array $remove_fields
  * @return array
  * @throws HTTP_API_Exception
  */
 public function filtered_fields($fields, $remove_fields = array())
 {
     if (!is_array($fields)) {
         $fields = array($fields);
     }
     $secured_fields = array_intersect($this->_secured_columns, $fields);
     // Exclude fields
     $fields = array_diff($fields, $remove_fields);
     // TODO сделать проверку токена, выдаваемого под API
     if (!empty($secured_fields) and !Auth::is_logged_in('login')) {
         throw HTTP_API_Exception::factory(API::ERROR_PERMISSIONS, 'You don`t have permissions to access to this fields (:fields).', array(':fields' => implode(', ', $secured_fields)));
     }
     $fields = array_intersect(array_keys($this->_table_columns), $fields);
     foreach ($fields as $i => $field) {
         $fields[$i] = $this->table_name() . '.' . $field;
     }
     return $fields;
 }
Beispiel #9
0
 public function character($id = false)
 {
     // load the models
     $this->load->model('ranks_model', 'ranks');
     $this->load->model('positions_model', 'pos');
     $this->load->model('posts_model', 'posts');
     $this->load->model('personallogs_model', 'logs');
     $this->load->model('news_model', 'news');
     $this->load->model('awards_model', 'awards');
     $this->load->helper('utility');
     $id = is_numeric($id) ? $id : false;
     $character = $this->char->get_character($id);
     $data['postcount'] = 0;
     $data['logcount'] = 0;
     $data['newscount'] = 0;
     $data['awardcount'] = 0;
     if ($character !== false) {
         $data['postcount'] = $this->posts->count_character_posts($id);
         $data['logcount'] = $this->logs->count_character_logs($id);
         $data['newscount'] = $this->news->count_character_news($id);
         $data['awardcount'] = $this->awards->count_character_awards($id);
         $data['last_post'] = mdate($this->options['date_format'], gmt_to_local($character->last_post, $this->timezone, $this->dst));
         $name_array = array('first_name' => $character->first_name, 'middle_name' => $character->middle_name, 'last_name' => $character->last_name, 'suffix' => $character->suffix);
         $name = parse_name($name_array);
         $abbr_name = parse_name(array('first_name' => $character->first_name, 'last_name' => $character->last_name));
         $rank = $this->ranks->get_rank($character->rank, 'rank_name');
         $data['character_info'] = array(array('label' => ucfirst(lang('labels_name')), 'value' => $name), array('label' => ucfirst(lang('global_position')), 'value' => $this->pos->get_position($character->position_1, 'pos_name')), array('label' => ucwords(lang('order_second') . ' ' . lang('global_position')), 'value' => $this->pos->get_position($character->position_2, 'pos_name')), array('label' => ucfirst(lang('global_rank')), 'value' => $rank));
         $data['character']['id'] = $id;
         $data['character']['name'] = $name;
         $data['character']['rank'] = $character->rank;
         $data['character']['position_1'] = $character->position_1;
         $data['character']['position_2'] = $character->position_2;
         $data['character']['user'] = $character->user;
         if ($character->images > '') {
             $images = explode(',', $character->images);
             $images_count = count($images);
             $src = strstr($images[0], 'http://') !== false ? $images[0] : base_url() . Location::asset('images/characters', trim($images[0]));
             $data['character']['image'] = array('src' => $src, 'alt' => $name, 'class' => 'image', 'width' => 200);
             $data['character']['image_array'] = array();
             for ($i = 1; $i < $images_count; $i++) {
                 $src = strstr($images[$i], 'http://') !== false ? trim($images[$i]) : base_url() . Location::asset('images/characters', trim($images[$i]));
                 $data['character']['image_array'][] = array('src' => $src, 'alt' => $name, 'class' => 'image');
             }
         } else {
             $data['character']['noavatar'] = array('src' => Location::img('no-avatar.png', $this->skin, 'main'), 'alt' => '', 'class' => 'image', 'width' => 200);
         }
         $tabs = $this->char->get_bio_tabs();
         $sections = $this->char->get_bio_sections();
         if ($tabs->num_rows() > 0) {
             $i = 1;
             foreach ($tabs->result() as $tab) {
                 $data['tabs'][$i]['id'] = $tab->tab_id;
                 $data['tabs'][$i]['name'] = $tab->tab_name;
                 $data['tabs'][$i]['link'] = $tab->tab_link_id;
                 ++$i;
             }
         }
         if ($sections->num_rows() > 0) {
             $i = 1;
             foreach ($sections->result() as $sec) {
                 $fields = $this->char->get_bio_fields($sec->section_id);
                 if ($fields->num_rows() > 0) {
                     $j = 1;
                     foreach ($fields->result() as $field) {
                         $data['fields'][$sec->section_id][$j]['label'] = $field->field_label_page;
                         $data['fields'][$sec->section_id][$j]['value'] = false;
                         $info = $this->char->get_field_data($field->field_id, $id);
                         if ($info->num_rows() > 0) {
                             foreach ($info->result() as $item) {
                                 $data['fields'][$sec->section_id][$j]['value'] = $item->data_value;
                             }
                         }
                         ++$j;
                     }
                 }
                 if ($tabs->num_rows() > 0) {
                     $data['sections'][$sec->section_tab][$i]['id'] = $sec->section_id;
                     $data['sections'][$sec->section_tab][$i]['name'] = $sec->section_name;
                 } else {
                     $data['sections'][$i]['id'] = $sec->section_id;
                     $data['sections'][$i]['name'] = $sec->section_name;
                 }
                 ++$i;
             }
         }
         // set the header
         $data['header'] = $rank . ' ' . $abbr_name;
         $this->_regions['title'] .= ucfirst(lang('labels_biography')) . ' - ' . $abbr_name;
     } else {
         $data['header'] = sprintf(lang('error_title_invalid_char'), ucfirst(lang('global_character')));
         $data['msg_error'] = sprintf(lang_output('error_msg_invalid_char'), lang('global_character'));
         $this->_regions['title'] .= lang('error_pagetitle');
     }
     if (Auth::is_logged_in()) {
         $data['edit_valid_form'] = Auth::check_access('site/bioform', false) ? true : false;
         if (Auth::check_access('characters/bio', false) === true) {
             if (Auth::get_access_level('characters/bio') == 3) {
                 $data['edit_valid'] = true;
             } elseif (Auth::get_access_level('characters/bio') == 2) {
                 $characters = $this->char->get_user_characters($this->session->userdata('userid'), '', 'array');
                 $data['edit_valid'] = (in_array($id, $characters) or $character->crew_type == 'npc') ? true : false;
             } elseif (Auth::get_access_level('characters/bio') == 1) {
                 $characters = $this->char->get_user_characters($this->session->userdata('userid'), '', 'array');
                 $data['edit_valid'] = in_array($id, $characters);
             } else {
                 $data['edit_valid'] = false;
             }
         } else {
             $data['edit_valid'] = false;
         }
     } else {
         $data['edit_valid'] = false;
         $data['edit_valid_form'] = false;
     }
     $data['label'] = array('edit' => ucwords(lang('actions_edit') . ' ' . lang('global_character')), 'view_all_posts' => ucwords(lang('actions_seeall') . ' ' . lang('global_missionposts')), 'view_all_logs' => ucwords(lang('actions_seeall') . ' ' . lang('global_personallogs')), 'view_all_awards' => ucwords(lang('actions_seeall') . ' ' . lang('global_awards')), 'view_all_images' => ucwords(lang('actions_seeall') . ' ' . lang('labels_images')), 'view_user' => ucwords(lang('global_user') . ' ' . lang('labels_info')), 'mission_posts' => ucwords(lang('global_missionposts')), 'personal_logs' => ucwords(lang('global_personallogs')), 'news_items' => ucwords(lang('global_newsitems')), 'comments' => ucwords(lang('labels_comments')), 'last_post' => ucwords(lang('order_last') . ' ' . lang('global_post')), 'stats' => ucfirst(lang('labels_stats')), 'back_manifest' => LARROW . ' ' . ucfirst(lang('actions_back')) . ' ' . lang('labels_to') . ' ' . ucfirst(lang('labels_manifest')));
     $this->_regions['content'] = Location::view('personnel_character', $this->skin, 'main', $data);
     $this->_regions['javascript'] = Location::js('personnel_character_js', $this->skin, 'main');
     Template::assign($this->_regions);
     Template::render();
 }
Beispiel #10
0
*
* Copyright (C) 2003 - 2007 phpScheduleIt
* License: GPL, see LICENSE
*/
list($s_sec, $s_msec) = explode(' ', microtime());
// Start execution timer
/**
* Include Template class
*/
include_once 'lib/Template1.class.php';
/**
* Include scheduler-specific output functions
*/
include_once 'lib/Schedule1.class.php';
// Check that the user is logged in
if (!Auth::is_logged_in()) {
    Auth::print_login_msg();
}
$t = new Template1(translate('Online Scheduler'));
$s = new Schedule(isset($_GET['scheduleid']) ? $_GET['scheduleid'] : null);
// Print HTML headers
$t->printHTMLHeader();
// Print welcome box
$t->printWelcome();
// Begin main table
$t->startMain();
ob_start();
// The schedule may take a long time to print out, so buffer all of that HTML data
if ($s->isValid) {
    // Print Calendar Navigation on the left side
    $t->startNavLinkTable();
Beispiel #11
0
 /**
  * 
  * @return Response
  * @throws HTTP_API_Exception
  */
 public function execute()
 {
     $this->_model = ORM::factory('Api_Key');
     if ($this->request->action() == 'index' or $this->request->action() == '') {
         $action = 'rest_' . $this->request->method();
     } else {
         // Determine the action to use
         $action = $this->request->method() . '_' . $this->request->action();
     }
     $action = strtolower($action);
     $is_logged_in = Auth::is_logged_in();
     try {
         /**
          * Если выключено API, запретить доступ не авторизованным пользователям к нему
          */
         if (Config::get('api', 'mode') == 'no' and (!$is_logged_in and $this->is_backend())) {
             throw new HTTP_Exception_403('Public API is disabled');
         }
         /**
          * Если невалидный ключ и пользователь не авторизован 
          * или экшен не публичный то запретить доступ к API
          */
         if (!$is_logged_in and !in_array($action, $this->public_actions)) {
             if (!$this->_model->is_valid($this->param('api_key'))) {
                 throw new HTTP_Exception_403('API key not valid');
             }
         }
         // Execute the "before action" method
         $this->before();
         /**
          * Проверка токена на валидность, если этого требует экшен или контроллер
          */
         if ($this->_check_token !== FALSE) {
             $this->_check_token();
         }
         // If the action doesn't exist, it's a 404
         if (!method_exists($this, $action)) {
             throw HTTP_API_Exception::factory(API::ERROR_PAGE_NOT_FOUND, 'The requested method ":method" was not found on this server.', array(':method' => $action))->request($this->request);
         }
         // Execute the action itself
         $this->{$action}();
     } catch (HTTP_API_Exception $e) {
         $this->json = $e->get_response();
     } catch (API_Validation_Exception $e) {
         $this->json = $e->get_response();
     } catch (ORM_Validation_Exception $e) {
         $this->json = array('code' => API::ERROR_VALIDATION, 'message' => rawurlencode($e->getMessage()), 'response' => NULL, 'errors' => $e->errors('validation'));
     } catch (Validation_Exception $e) {
         $this->json = array('code' => API::ERROR_VALIDATION, 'message' => rawurlencode($e->getMessage()), 'response' => NULL, 'errors' => $e->errors('validation'));
     } catch (Exception $e) {
         $this->json['code'] = $e->getCode();
         $this->json['line'] = $e->getLine();
         $this->json['file'] = $e->getFile();
         $this->json['message'] = $e->getMessage();
         $this->json['response'] = NULL;
     }
     // Execute the "after action" method
     $this->after();
     // Return the response
     return $this->response;
 }
Beispiel #12
0
<?php

defined('SYSPATH') or die('No direct access allowed.');
if (IS_BACKEND) {
    Route::set('datasources', ADMIN_DIR_NAME . '/<directory>(/<controller>(/<action>(/<id>)))', array('directory' => '(datasources|' . implode('|', array_keys(Datasource_Data_Manager::types())) . ')'))->defaults(array('directory' => 'datasources', 'controller' => 'data', 'action' => 'index'));
}
Observer::observe('modules::after_load', function () {
    if (!IS_BACKEND or !Auth::is_logged_in()) {
        return;
    }
    $types = Datasource_Data_Manager::types();
    if (empty($types)) {
        return;
    }
    try {
        $ds_section = Model_Navigation::get_section('Datasources');
        $ds_section->icon = 'tasks';
        $sections_list = Datasource_Data_Manager::get_tree(array_keys($types));
        $datasource_is_empty = empty($sections_list);
        $folders = Datasource_Folder::get_all();
        $root_sections = array();
        foreach ($sections_list as $type => $sections) {
            foreach ($sections as $id => $section) {
                if ($section->show_in_root_menu()) {
                    $root_sections[] = $section;
                    unset($sections_list[$type][$id]);
                    continue;
                }
                if (array_key_exists($section->folder_id(), $folders)) {
                    $folders[$section->folder_id()]['sections'][] = $section;
                    unset($sections_list[$type][$id]);
Beispiel #13
0
/**
* Prints out the textboxes and buttons for the self registration
* @param bool $allow_participation if self registration is allowed for registered users
* @param bool $allow_anon_participation if self registration is allowed for non registered users
*/
function print_join_form($allow_participation, $allow_anon_participation, $parentid)
{
    $join = translate('Join');
    $allow_participation = $allow_participation && Auth::is_logged_in();
    $allow_anon_participation = $allow_anon_participation && !Auth::is_logged_in();
    ?>
</tr><tr><td colspan="3">
<p align="center" style="margin-top:10px;"><a href="javascript:showHide('join_options');"><?php 
    echo translate('My Participation Options');
    ?>
</a></p>
<div id="join_options" style="display:none;">
<?php 
    if ($allow_participation) {
        echo '<input type="hidden" name="join_userid" id="join_userid" value="' . Auth::getCurrentID() . '"/>';
    } else {
        if ($allow_anon_participation) {
            ?>
<table width="100%" border="0" style="border: dashed 1px #DDDDDD;background-color:#FFFFFF;" align="center">
<tr>
	<td align="right" width="20%"><?php 
            echo translate('First Name');
            ?>
</td>
	<td><input type="text" name="join_fname" id="join_fname" class="textbox" maxlength="30"/></td>
</tr>
<tr>
	<td align="right"><?php 
            echo translate('Last Name');
            ?>
</td>
	<td><input type="text" name="join_lname" id="join_lname" class="textbox" maxlength="30"/></td>
</tr>
<tr>
	<td align="right"><?php 
            echo translate('Email');
            ?>
</td>
	<td><input type="text" name="join_email" id="join_email" class="textbox" maxlength="75"/></td>
</tr>
</table>
<?php 
        }
    }
    if ($allow_participation || $allow_anon_participation) {
        echo '<p align="center">';
        echo '<button type="button" name="btn_join" value="' . $join . '" class="button" onclick="submitJoinForm(' . (int) $allow_participation . ');">' . $join . '</button>';
        //echo ($parentid != null) ? ' <input type="checkbox" name="join_parentid"/> ' . translate('Join All Recurring') : '';
        echo '</p>';
    }
    ?>
</div>
</td>
<?php 
}
Beispiel #14
0
 /**
  * Рендер виджета во Frontend
  * 
  * Отключение комментариев для блока
  * 
  *		Block::run('block_name', array('comments' => FALSE));
  * 
  * Отключение кеширования виджетов в блоке
  * 
  *		Block::run('block_name', array('caching' => FALSE));
  * 
  * @param array $params Дополнительные параметры
  */
 public function render(array $params = array())
 {
     // Проверка прав на видимость виджета
     if (!empty($this->roles)) {
         if (Auth::is_logged_in()) {
             if (!Auth::has_permissions($this->roles, FALSE)) {
                 return;
             }
         } else {
             return;
         }
     }
     if (Kohana::$profiling === TRUE) {
         $benchmark = Profiler::start('Widget render', $this->name);
     }
     $this->_fetch_template();
     $this->set_params($params);
     $allow_omments = (bool) Arr::get($this->template_params, 'comments', TRUE);
     $caching = (bool) Arr::get($this->template_params, 'caching', $this->caching);
     if ($this->block == 'PRE' or $this->block == 'POST') {
         $allow_omments = FALSE;
     }
     if (Kohana::$caching === FALSE or $caching === FALSE) {
         $this->caching = FALSE;
     }
     if (Arr::get($this->template_params, 'return') === TRUE) {
         return $this->_fetch_render();
     }
     if ($allow_omments) {
         echo "<!--{Widget: {$this->name}}-->";
     }
     if ($this->caching === TRUE and !Fragment::load($this->get_cache_id(), $this->cache_lifetime, TRUE)) {
         echo $this->_fetch_render();
         Fragment::save_with_tags($this->cache_lifetime, $this->cache_tags);
     } else {
         if (!$this->caching) {
             echo $this->_fetch_render();
         }
     }
     if ($allow_omments) {
         echo "<!--{/Widget: {$this->name}}-->";
     }
     if (isset($benchmark)) {
         Profiler::stop($benchmark);
     }
 }
        self::create_user();
        return $_SESSION[Config::$sitename]['user']['id'];
    }
    public static function is_admin()
    {
        self::create_user();
        return !!$_SESSION[Config::$sitename]['user']['is_admin'];
    }
    public static function is_logged_in()
    {
        self::create_user();
        return !!$_SESSION[Config::$sitename]['user']['logged_in'];
    }
    public static function user()
    {
        return self::$user;
    }
    private static function create_user()
    {
        if (!isset($_SESSION[Config::$sitename]['user'])) {
            $_SESSION[Config::$sitename]['user'] = array();
            $_SESSION[Config::$sitename]['user']['id'] = 0;
            $_SESSION[Config::$sitename]['user']['is_admin'] = false;
            $_SESSION[Config::$sitename]['user']['logged_in'] = false;
        }
    }
}
if (Config::$auth_table && Auth::is_logged_in()) {
    Auth::$user = new Model(Config::$auth_table);
    Auth::$user->load(Auth::user_id());
}
<?php

require_once "auth.php";
$db = new Database();
$auth = new Auth($db);
$auth->restore_session();
if (!$auth->is_logged_in()) {
    die("Unauthorized");
}
$result = $db->query("SELECT * FROM rsvp_data");
if (!$result) {
    echo "<br>Could not fetch data from database.\n";
    exit;
}
?>

<h3 style="text-align: center;">RSVP Data</h3>
</br>
<table id="table_id" class="display table table-striped table-condensed table-hover">
    <thead style="font-size:0.8em;text-transform:uppercase">
        <tr>
            <th>Date</th>
            <th>People</th>
            <th>Party Size</th>
            <th>Attending?</th>
            <th>Email</th>
            <th>Notes</th>
        </tr>
    </thead>
    <tbody>
<?php 
Beispiel #17
0
        }
    }
}
// If we are editing and have not yet submitted an update
if ($edit && !isset($_POST['update'])) {
    $user = new User($id);
    $data = $user->get_user_data();
    $data['emailaddress'] = $data['email'];
    // Needed to be the same as the form
} else {
    $data = CmnFns::cleanPostVals();
}
if (isset($_POST['register'])) {
    // New registration
    $data['lang'] = determine_language();
    $adminCreated = Auth::is_logged_in() && Auth::isAdmin();
    $msg = $auth->do_register_user($data, $adminCreated);
    $show_form = false;
} else {
    if (isset($_POST['update'])) {
        // Update registration
        $adminUpdate = $curUser->get_id() != $id && (Auth::isAdmin() || $curUser->is_group_admin(array($id)));
        $msg = $auth->do_edit_user($data, $adminUpdate);
        $show_form = false;
    }
}
// Print HTML headers
$t->printHTMLHeader();
$t->set_title($edit ? translate('Modify My Profile') : translate('Register'));
// Print the welcome banner if they are logged in
if ($edit || !(bool) $conf['app']['allowSelfRegistration']) {
Beispiel #18
0
require_once 'tatt/common.php';
if (!defined('IN_TATT')) {
    exit;
}
//TODO: REMOVE THIS LINE BEFORE SITE GOES LIVE
/****************** DEBUG LINE *********************/
$_GET['pagedebug'] = 'true';
/********************* END ********************/
//Establish session
session_start();
//------- COMMON VARIABLES
$page = new Page();
$auth = new Auth($db);
//Checks Auth at object creation
$user = NULL;
$page->assign('logged_in', $auth->is_logged_in());
$page->assign('redirect_url', encode_decode_redirect_url($_SERVER['REQUEST_URI']));
$page->load_javascript_include('jquery-1.6.4.min.js');
if ($auth->is_logged_in()) {
    $user_id = $auth->get_user_id();
    $user = new User($user_id);
    $page->assign('username', $user->get_username());
    $page->assign('user_id', $user_id);
}
//Query logging
$db->enable_query_logging(FALSE);
$page_debugging = FALSE;
if (isset($_GET['pagedebug']) && $_GET['pagedebug'] == 'true' && $auth->is_moderator()) {
    ini_set('display_errors', 'On');
    error_reporting(E_ALL | E_STRICT);
    $page_debugging = TRUE;
Beispiel #19
0
} else {
    if (isset($_POST["submit"]) && isset($_POST["username"]) && isset($_POST["password"])) {
        $auth->login($_POST["username"], $_POST["password"]);
    } else {
        $auth->restore_session();
    }
}
$table_include = "form_results.php";
?>

<!DOCTYPE html>
<html>
<head>
	<meta charset="utf-8">
	<title><?php 
echo $auth->is_logged_in() ? "Admin Console" : "Welcome | Login";
?>
</title>
	<meta name="viewport" content="width=device-width, initial-scale=1">
    <style media="screen">
        html, body {
            font-family: -apple-system, avenir, 'avenir next', roboto, 'helvetica neue', helvetica, ubuntu, arial, sans-serif !important;
        }
    </style>
    <link rel="stylesheet" type="text/css" href="https://cdn.datatables.net/s/bs-3.3.5/jq-2.1.4,jszip-2.5.0,pdfmake-0.1.18,dt-1.10.10,b-1.1.0,b-colvis-1.1.0,b-html5-1.1.0,b-print-1.1.0,cr-1.3.0,fh-3.1.0,r-2.0.0,sc-1.4.0/datatables.min.css"/>

    <script type="text/javascript" src="https://cdn.datatables.net/s/bs-3.3.5/jq-2.1.4,jszip-2.5.0,pdfmake-0.1.18,dt-1.10.10,b-1.1.0,b-colvis-1.1.0,b-html5-1.1.0,b-print-1.1.0,cr-1.3.0,fh-3.1.0,r-2.0.0,sc-1.4.0/datatables.min.js"></script>
</head>
<body style="background-color: #d7d7d7;">
    <?php 
if ($auth->is_logged_in()) {
Beispiel #20
0
						<p><?php 
echo myTruncate($product->description, 200, " ");
?>
</p>
						<p><a href="/pokecart/product/<?php 
echo $product->id;
?>
/view">Read More</a></p>
						<p>
							<span class="btn btn-primary fixed-b fixed" role="button">$<?php 
echo number_format($product->price, 2, '.', '');
?>
</span>
							

							<? if(Auth::is_logged_in()) : ?>
							<a href="/pokecart/cart/add/<?php 
echo $product->id;
?>
" class="btn btn-primary add-to-cart" role="button">
								<i class="fa fa-shopping-cart"></i> Add to Cart
							</a>

						<? endif ?>

						


							
						</p>
					</div>
Beispiel #21
0
<?php

defined('SYSPATH') or die('No direct script access.');
if ($plugin->get('maintenance_mode') == Config::YES and !Auth::is_logged_in()) {
    Observer::observe('frontpage_requested', function () {
        $page = DB::select()->from('pages')->where('behavior_id', '=', 'maintenance_mode')->limit(1)->as_object()->execute()->current();
        if ($page) {
            $page = Model_Page_Front::find($page->slug);
            // if we fund it, display it!
            if (is_object($page)) {
                echo Response::factory()->status(403)->body($page->render_layout());
                exit;
            }
        } else {
            throw new HTTP_Exception_403('Maintenance mode');
            exit;
        }
    });
}