Beispiel #1
0
 protected function on_auth_error()
 {
     if (!is_null($this->_login_route) and !Auth::instance()->logged_in()) {
         HTTP::redirect(Extasy_Url::url_to_route($this->_login_route) . '?return=' . $this->request->uri());
     }
     $this->forward_403();
 }
Beispiel #2
0
 public function before_fetch(ORM $item)
 {
     if (isset($_GET['cancel_filter'])) {
         $this->redirect('/' . Extasy_Url::url_to_route($this->get_index_route()));
     }
     return parent::before_fetch($item);
 }
Beispiel #3
0
 public function back($default_route)
 {
     $url = $this->_return_location;
     if (is_null($url)) {
         $url = Extasy_Url::url_to_route($default_route);
     }
     HTTP::redirect($url);
 }
Beispiel #4
0
 public static function link_to_route($route_str, $title = NULL, array $attributes = NULL, $protocol = NULL)
 {
     if (!isset($attributes['title'])) {
         $attributes['title'] = $title;
         $attributes['class'] = 'name';
     }
     return HTML::anchor(Extasy_Url::url_to_route($route_str), $title, $attributes, $protocol);
 }
Beispiel #5
0
 public function action_delete()
 {
     $item = $this->get_item();
     if (!$item->allow_delete()) {
         $this->forward_403();
     }
     $this->delete_routine($item);
     $this->redirect('/' . Extasy_Url::url_to_route($this->get_index_route()));
 }
Beispiel #6
0
 public function before_fetch(ORM $item)
 {
     if (isset($_GET['cancel_filter'])) {
         $this->redirect('/' . Extasy_Url::url_to_route($this->get_index_route()));
     }
     $filter_form = new Form_Filter_Reviews($item);
     if (isset($_GET['filter'])) {
         $filter_form->submit();
     }
     $this->template->filter_form = $filter_form;
     return parent::before_fetch($item);
 }
Beispiel #7
0
 public function action_index()
 {
     $referer = arr::get($_SERVER, 'HTTP_REFERER');
     $referer_parts = explode('/', $referer);
     foreach ($referer_parts as $part) {
         $id = intval($part);
     }
     $referer_page_type = ORM::factory('Page')->get_page_type($id);
     if ($referer_page_type) {
         HTTP::redirect('/' . Extasy_Url::url_to_route('admin-static'));
     }
     HTTP::redirect('/' . Extasy_Url::url_to_route('admin-dynamic'));
 }
Beispiel #8
0
 public function action_index()
 {
     $write_allowed = ACL::is_action_allowed('admin', 'config', 'write');
     $this->template->write_allowed = $write_allowed;
     if (isset($_POST['cancel'])) {
         $this->redirect('/' . Extasy_Url::url_to_route('admin-config'));
     }
     $form = new Form_Config();
     if (!$write_allowed) {
         $form->set_read_only();
     }
     if ($write_allowed and isset($_POST['submit']) and $form->submit()) {
         $this->redirect('/' . Extasy_Url::url_to_route('admin-config'));
     }
     $this->template->form = $form;
 }
Beispiel #9
0
 public static function get_route_params($route_str)
 {
     $route_params = Extasy_Url::parse_get($route_str);
     $route_str = Extasy_Url::strip_get($route_str);
     if (strpos($route_str, ':') !== FALSE) {
         $route_arr = explode(':', $route_str);
         $route_name = $route_arr[0];
         $route_target = $route_arr[1];
         $route_target = explode('/', $route_target);
         $params['action'] = array_pop($route_target);
         if ($controller = array_pop($route_target)) {
             $params['controller'] = $controller;
         }
         if ($directory = array_pop($route_target)) {
             $params['directory'] = $directory;
         }
         return Arr::merge($params, $route_params);
     } else {
         return $route_params;
     }
 }
Beispiel #10
0
 public function action_index()
 {
     $this->redirect('/' . Extasy_Url::url_to_route(Kohana::$config->load('extasy.redirect_from_index')));
 }
Beispiel #11
0
 public static function menu_row($id, $name, $route = NULL, $parent = -1)
 {
     if (!is_null($route)) {
         $url = url::base() . Extasy_Url::url_to_route($route);
     } else {
         $url = NULL;
     }
     $title = $name;
     return View::factory('cms/menu_row', array('id' => $id, 'name' => $name, 'title' => $title, 'url' => $url, 'parent' => $parent));
 }
Beispiel #12
0
<?php

defined('SYSPATH') or die('No direct script access.');
/**
 * @version SVN: $Id:$
 */
?>
Чтобы сбросить свой пароль, перейдите по следующей ссылке:

<?php 
echo URL::base(FALSE, 'http') . Extasy_Url::url_to_route('admin-auth:reset_password_step_2?code=' . $code);
Beispiel #13
0
						<?php 
        }
        ?>
					</ul>
				</li>
			<?php 
    } else {
        ?>
				<?php 
        $nameParts = Helpers_Menu::getNameParts($name);
        ?>
				<li  class="item<?php 
        echo $i;
        ?>
"><a href="/<?php 
        echo Extasy_Url::url_to_route($route);
        ?>
"><?php 
        echo $nameParts['icon'];
        ?>
<span class="hidden-sm text"> <?php 
        echo $nameParts['name'];
        ?>
</span></a></li>
			<?php 
    }
    ?>
		<?php 
    $i++;
}
?>
Beispiel #14
0
					</td>
				</tr>
		{% } %}
		</script>
    </head>
    <body>
		<header class="navbar">
			<div class="container">
				<button class="navbar-toggle" type="button" data-toggle="collapse" data-target=".sidebar-nav.nav-collapse">
					<span class="icon-bar"></span>
					<span class="icon-bar"></span>
					<span class="icon-bar"></span>
				</button>
				<a id="main-menu-toggle" class="hidden-xs open"><i class="fa fa-bars"></i></a>
				<a class="navbar-brand col-md-2 col-sm-1 col-xs-2" href="<?php 
echo '/' . Extasy_Url::url_to_route(Kohana::$config->load('extasy.redirect_from_index'));
?>
"><span>Ariol</span></a>
				<div class="nav-no-collapse header-nav">
					<?php 
if (Auth::instance()->logged_in('admin')) {
    ?>
						<ul class="nav navbar-nav pull-right">
							<li style="padding: 10px;">
								Товаров на сайте: <?php 
    echo ORM::factory('Product')->where('active', '=', 1)->count_all();
    ?>
							</li>
							<li class="dropdown">
								<a class="btn account dropdown-toggle" data-toggle="dropdown">
									<div class="user">
Beispiel #15
0
 public function action_reset_password_step_2()
 {
     if ($this->do_reset_password_step_2()) {
         HTTP::redirect('/' . Extasy_Url::url_to_route('admin-index'));
     }
 }