Ejemplo n.º 1
0
                Xysti::error(500, 'Default auth currently not configured for activation.');
                // Sentry auth
            } elseif ($auth_driver == 'sentry') {
                try {
                    $activate_user = Sentry::activate_user(URI::segment(2), URI::segment(3), FALSE);
                } catch (Sentry\SentryException $e) {
                    // issue activating the user
                    // store/set and display caught exceptions such as a suspended user with limit attempts feature.
                    $errors = $e->getMessage();
                }
            } else {
                return Xysti::error(500, 'Unknown authentication driver.');
            }
            if ($activate_user) {
                //Sentry::force_login(URI::segment(2));
                return Redirect::to(Xysti::page('login', 'post_login'));
            } else {
                return Xysti::make(500, 'User activation failed.');
            }
        });
    }
}
// 	Downloads routes
// ------------------------------------------------
if (Config::get('xysti.routes.downloads')) {
    /**
     * Download file
     */
    if (Config::get('xysti.routes.downloads.download')) {
        Route::get(Config::get('xysti.routes.downloads.download') . '/(:any)', function ($request) {
            $downloads = Config::get('downloads');
Ejemplo n.º 2
0
/**
 * Output heading
 * 
 * Generate <h1>, <h2> etc
 * @param array $args
 */
function page_title($args = array())
{
    $args = array_merge(array('echo' => TRUE, 'a' => FALSE, 'tag' => 'h1', 'caption' => Xysti::page('caption'), 'href' => URI::current(), 'title' => Xysti::page('title')), $args);
    $output = '';
    $output .= '<' . $args['tag'] . '>';
    if ($args['a']) {
        $output .= '<a href="' . $args['href'] . '">';
    }
    $output .= $args['title'];
    if ($args['caption']) {
        $output .= ' <span class="caption">' . $args['caption'] . '</span>';
    }
    if ($args['a']) {
        $output .= '</a>';
    }
    $output .= '</' . $args['tag'] . '>' . PHP_EOL;
    if ($args['echo']) {
        echo $output;
    } else {
        return $output;
    }
}
Ejemplo n.º 3
0
 /**
  * Page variable
  * 
  * Checks wether a page variable is set in the sitemap and returns it
  * @param string $request The variable key to return
  * @param mixed $uri Optional segment # or URI
  * @return mixed
  */
 public static function page($request, $uri = NULL)
 {
     // Use current page if no second argument
     if (is_null($uri)) {
         // Check for a cached page
         if (is_null(Xysti::$page)) {
             Xysti::$page = Xysti::sitemap_page_walk(Xysti::uri_array());
         }
         // Take the page from the cache
         $page = Xysti::$page;
         // Segment number specified
     } elseif (is_int($uri)) {
         $page = Xysti::sitemap_page_walk(Xysti::uri_array(), $uri);
         // Segment string specified
     } elseif (is_string($uri)) {
         $page = Xysti::sitemap_page_walk(Xysti::uri_array($uri), Xysti::uri_count($uri));
         // Segment array specified
     } elseif (is_string($uri)) {
         $page = Xysti::sitemap_page_walk(Xysti::uri_array($uri), Xysti::uri_count($uri));
     } else {
         //Log::write('error', 'Unexpected Xysti::page(' . $request . ',' . $uri . ') call at ' . URI::current() . '.');
         return Xysti::error(500, 'Unexpected Xysti::page(' . $request . ',' . $uri . ') call at ' . URI::current() . '.');
     }
     // Fetch the meta regardless of whether a sitemap entry has been found
     return Xysti::meta($request, $page);
     // Page was found
     // @todo Remove this if statement on confirmation of working
     if ($page) {
         return Xysti::meta($request, $page);
     } else {
         //Log::write('error', 'Xysti::page(' . $request . ',' . $uri . ') could not be found at ' . URI::current() . '.');
         return FALSE;
     }
 }