Пример #1
0
 function show($api = null)
 {
     $path = func_get_args();
     if ($api == "api") {
         $path = array_slice($path, 1);
     }
     $file_id = $this->jugaad_model->get_path_id($path);
     $file_type = $this->jugaad_model->get_file_type($file_id);
     if (end($path) == 'index') {
         $this->http->redirect(locale_base_url() . implode("/", array_slice($path, 0, -1)) . "/");
     }
     // Check if index exists
     if ($file_type == 'directory') {
         $file_id = $this->jugaad_model->get_slug_id($file_id, 'index');
     }
     if ($file_id === false) {
         $this->http->response_code(404);
     }
     $file = $this->jugaad_model->get_file($file_id);
     $file["user_can"] = $this->perms_model->get_permissions($file_id, $this->user);
     if (!$file["user_can"]["read_file"]) {
         $this->http->response_code(404);
     }
     $template_meta = $this->template_model->get_meta($file["template"]);
     if ($template_meta === false) {
         $this->http->response_code(404);
     }
     if ($api == "api") {
         foreach ($template_meta as $name => $meta) {
             if (isset($meta["inApi"]) && $meta["inApi"] === false) {
                 unset($template_meta[$name]);
             }
         }
         $latest_version = $this->jugaad_model->get_latest_version_id_with_external_data($file_id, $template_meta, $this->user);
         if (!empty($_GET["prev_id"]) && $_GET["prev_id"] == $latest_version) {
             $this->http->response_code(304, false);
             exit;
         }
         $data = $this->jugaad_model->get_file_data($file_id, $template_meta, $this->user, true);
         header('Content-Type: application/json; charset=UTF-8');
         echo json_encode(["version_id" => $latest_version, "page_data" => $data], JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE);
     } else {
         $header = getallheaders();
         $is_ajax = isset($header["X-Ajax-Request"]) && $header["X-Ajax-Request"];
         if ($is_ajax) {
             foreach ($template_meta as $name => $meta) {
                 if (isset($meta["inAjax"]) && $meta["inAjax"] === false) {
                     unset($template_meta[$name]);
                 }
             }
         }
         $data = $this->jugaad_model->get_file_data($file_id, $template_meta, $this->user, true);
         $data["is_ajax"] = $is_ajax;
         $data["is_authenticated"] = $this->auth->is_authenticated();
         $data["user_nick"] = $this->auth->get_user();
         $view_name = $this->template_model->get_view_name($file["template"]);
         $data["page_slug"] = implode('__', $path);
         $this->load_view($view_name, $data);
     }
 }
Пример #2
0
 private function register_new_user()
 {
     $this->load_library("session_lib");
     $this->load_library("http_lib");
     $current_path = base_url() . substr(empty($_SERVER["PATH_INFO"]) ? "" : $_SERVER["PATH_INFO"], 1) . (empty($_SERVER["QUERY_STRING"]) ? "" : "?" . $_SERVER["QUERY_STRING"]);
     $this->session_lib->flash_set("auth_go_back", $current_path);
     $this->http_lib->redirect(locale_base_url() . "auth/register/");
 }
Пример #3
0
</p>
        </div>
        <div class="col6">
            <h2><?php 
echo __('Events');
?>
</h2>
            <div class="event-list">
                <?php 
if (count($events_to_display)) {
    ?>
                    <?php 
    foreach ($events_to_display as $event) {
        ?>
                        <a class="event btn" href="<?php 
        echo locale_base_url() . substr($event['path'], 1);
        ?>
">
                            <p class="lead"><?php 
        echo __($event['data']['name']);
        ?>
</p>
                            <?php 
        if (!empty($event['data']['tagline'])) {
            ?>
                                <p><small><?php 
            echo __($event['data']['tagline']);
            ?>
</small></p>
                            <?php 
        }
Пример #4
0
        <div class="header-content">
            <h1 class="title"><a href="<?php 
echo locale_base_url();
?>
"><?php 
echo __('Felicity');
?>
</a></h1>
            <p class="year">2016</p>
        </div>
    </header>
    <div class="wrapper">
        <div class="container title-and-nav-container clearfix">
            <div class="page-title text-left">
                <h1><a href="<?php 
echo locale_base_url() . $contest_page_link;
?>
"><?php 
echo __($name);
?>
</a></h1>
                <p><?php 
echo __($tagline);
?>
</p>
            </div>
        </div>
        <div class="container">
            <h2 class="text-center"><?php 
echo __('Final Scoreboard');
?>
</div>
    <?php 
    }
};
?>

<style>
.pure-form input[type="text"][disabled] {
    color: #555;
}
</style>
<article class="page open full">
    <div class="container">
        <h1 class="text-center">
            <small><a class="underlined" href="<?php 
echo locale_base_url();
?>
litcafe/ttt-workshop/"><?php 
echo __('Terribly Tiny Tales Workshop');
?>
</a></small><br/>
            <?php 
echo __('Register');
?>
        </h1>
        <?php 
if ($user_details) {
    ?>
            <?php 
    if ($user_details['payment_status'] == 'success') {
        ?>
Пример #6
0
        ?>
                            <td class="day">
                                <?php 
        echo $formatted;
        ?>
                            </td>
                        <?php 
    } else {
        ?>
                            <td class="day"></td>
                        <?php 
    }
    ?>
                        <td class="event-container">
                            <a href="<?php 
    echo locale_base_url() . $event['path'];
    ?>
" class="event">
                                <div class="circle"><div class="innercircle"></div></div>
                                <span><?php 
    echo __($event['data']['name']);
    ?>
</span>
                            </a>
                        </td>
                    </tr>
                <?php 
}
?>
            </tbody>
        </table>
<?php

$this->load_fragment('auth/form_header', ['heading' => __('Email successfully verified!')]);
?>
<div class="row">
    <div class="col6 offset3 text-center">
        <p class="lead"><?php 
echo __('Success!');
?>
</p>
        <p><?php 
echo __('You have successfully verified your email address.');
?>
</p>
        <div>
            <a href="<?php 
echo locale_base_url() . "auth/login/";
?>
" class="pure-button pure-button-primary"><?php 
echo __('Continue magical journey');
?>
</a>
        </div>
    </div>
</div>
<?php 
$this->load_fragment('auth/form_footer');
Пример #8
0
<?php

$this->load_fragment('auth/form_header', ['heading' => __('Email Verification Required')]);
?>
<div class="pure-g">
    <div class="pure-u-1-5">&nbsp;</div>
    <div class="pure-u-3-5">
        <p style="font-size: 1.2em; line-height: 1.5em;"><?php 
echo __('Your email has not yet been verified. Please click the verification link you received in your email to proceed.');
?>
</p>
        <div class="text-right">
            <a href="<?php 
echo locale_base_url() . "auth/resend_mail/";
?>
" class="pure-button pure-button-primary"><?php 
echo __('Resend email');
?>
</a>
        </div>
    </div>
    <div class="pure-u-1-5">&nbsp;</div>
</div>
<?php 
$this->load_fragment('auth/form_footer');
Пример #9
0
 public function register()
 {
     $this->http_lib->redirect(locale_base_url() . 'auth/login/');
 }
Пример #10
0
<div class="success"><?php 
    echo __('Password successfully set!');
    ?>
</div>
<a href="<?php 
    echo locale_base_url() . "auth/login/";
    ?>
" class="some-top-margin pure-button pure-button-primary pure-button-large"><?php 
    echo __('Continue to a magical journey');
    ?>
</a>
<?php 
} else {
    ?>
<form action="<?php 
    echo locale_base_url() . "auth/register/password_reset/";
    ?>
" method="post" class="pure-form pure-form-stacked">
    <fieldset>
        <input type="hidden" name="hash" value="<?php 
    echo $hash;
    ?>
">

        <label for=""><?php 
    echo __('Password:');
    ?>
</label>
        <input type="password" name="password" required>

        <label for=""><?php 
Пример #11
0
                if (!isset($categorised_event[$category])) {
                    $categorised_event[$category] = [];
                }
                array_unshift($categorised_event[$category], $event);
            } else {
                $categorised_event[$category][] = $event;
            }
        }
    }
    if (!isset($page_slug)) {
        $page_slug = "static";
    }
    $primary_nav_link = function ($name, $display_name, $image) use($page_slug) {
        ?>
        <a href="<?php 
        echo locale_base_url() . $name;
        ?>
/" data-href="<?php 
        echo $name;
        ?>
" class="primary-nav-link <?php 
        echo $name;
        echo $name == $page_slug ? ' open' : '';
        ?>
">
            <img src="<?php 
        echo base_url();
        ?>
static/images/<?php 
        echo $image;
        ?>
Пример #12
0
 public function wdw()
 {
     $this->http_lib->redirect(locale_base_url() . 'talks-and-workshops/web-development/');
 }
Пример #13
0
 function login()
 {
     if (!empty($_GET['next'])) {
         $next_url = base_url() . $_GET['next'];
         $this->session_lib->flash_set("auth_next_page", $next_url);
     }
     $this->auth_lib->force_authentication();
     $next_page = $this->session_lib->flash_get("auth_next_page");
     if (empty($next_page)) {
         $next_page = locale_base_url();
     }
     $this->http->redirect($next_page);
 }