示例#1
0
 public function __construct()
 {
     global $GLOBALS, $data;
     self::$editors =& $GLOBALS;
     self::$data =& $data;
     self::$url = Options::get('siteurl');
     self::$domain = Options::get('sitedomain');
     self::$name = Options::get('sitename');
     self::$key = Options::get('sitekeywords');
     self::$desc = Options::get('sitedesc');
     self::$email = Options::get('siteemail');
     self::$slogan = Options::get('siteslogan');
 }
示例#2
0
?tag=<?php 
        echo Notification::get('tag');
    }
    ?>
"><?php 
    echo $parent_page['title'];
    ?>
</a>&nbsp;<span>&rarr;</span>&nbsp;<a href="<?php 
    echo Site::url() . $page['parent'] . '/' . $page['slug'];
    ?>
"><?php 
    echo $page['title'];
    ?>
</a>
<?php 
} else {
    ?>
    <a href="<?php 
    echo Site::url() . "/" . $page['slug'];
    if (Notification::get('tag')) {
        ?>
?tag=<?php 
        echo Notification::get('tag');
    }
    ?>
"><?php 
    echo $page['title'];
    ?>
</a>
<?php 
}
<svg version="1.1" class="tile_overlay" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
viewBox="0 0 330 200" style="enable-background:new 0 0 330 200;" xml:space="preserve">
<style>.tile_overlay_path_carnation {fill: #fff;}</style>
<path class="tile_overlay_path tile_overlay_path_carnation" d="M490.1,280.649c0,44.459-36.041,80.5-80.5,80.5s-80.5-36.041-80.5-80.5s36.041-80.5,80.5-80.5
S490.1,236.19,490.1,280.649z"/>
</svg>
<div class="overlay_content">
<h2>Carnation<br/></h2>
<a class="popup" data-toggle="modal" data-target="#galleryModal">
<i class="glyphicon glyphicon-info-sign"></i>
<div class="popup_content">
<p class="hero_url"><?php 
echo Site::url();
?>
/public/assets/img/gallery/carnation/carnation-popup.jpg</p>
<p class="title">Carnation Website</p>
<p class="tags">web development, responsive, IE7+</p>
<p class="description">
Carnation site was built with custom filter and dynamic recipes. The challenge was to make the filter easily usable on mobile.
</p>
<p class="preview_url">http://www.carnation.com.au</p>
</div>
</a>
<a href="http://www.carnation.com.au" class="url" target="_blank"><i class="glyphicon glyphicon-link"></i></a>
</div>
</div>
<img src="<?php 
echo Site::url();
?>
/public/assets/img/gallery/carnation/carnation.jpg">
</div>
示例#4
0
        // Update user hash
        $users->updateWhere("[login='******']", array('hash' => $new_hash));
        $mail = new PHPMailer();
        $mail->CharSet = 'utf-8';
        $mail->ContentType = 'text/html';
        $mail->SetFrom(Option::get('system_email'));
        $mail->AddReplyTo(Option::get('system_email'));
        $mail->AddAddress($user['email'], $user['login']);
        $mail->Subject = __('Your login details for :site_name', 'users', array(':site_name' => $site_name));
        $mail->MsgHTML(View::factory('box/emails/views/emails/email_layout')->assign('site_url', $site_url)->assign('site_name', $site_name)->assign('user_id', $user['id'])->assign('user_login', $user['login'])->assign('new_hash', $new_hash)->assign('email_template', 'reset-password')->render());
        $mail->Send();
        // Set notification
        Notification::set('success', __('Your login details for :site_name has been sent', 'users', array(':site_name' => $site_name)));
        Notification::set('reset_password', 'reset_password');
        // Redirect to password-reset page
        Request::redirect(Site::url() . '/admin');
    }
    Notification::setNow('reset_password', 'reset_password');
}
// If admin user is login = true then set is_admin = true
if (Session::exists('admin') && Session::get('admin') == true) {
    $is_admin = true;
} else {
    $is_admin = false;
}
// Logout user from system
if (Request::get('logout') && Request::get('logout') == 'do') {
    Session::destroy();
}
// If is admin then load admin area
if ($is_admin) {
" name="skype">
		</div>
		<div class="form-group">
			<label><?php 
echo __('About Me', 'users');
?>
</label>
			<textarea class="form-control" name="about_me"><?php 
echo $user['about_me'];
?>
</textarea>
		</div>
		<div class="form-group">
			<label><?php 
echo __('New Password', 'users');
?>
</label>
			<input class="form-control" type="text" name="new_password">
		</div>
		<div class="form-group">
		<input type="submit" class="btn btn-primary" value="<?php 
echo __('Save', 'users');
?>
" name="edit_profile">
		<?php 
echo Html::anchor(__('Cancel', 'users'), Site::url() . '/users/' . Uri::segment(1), array('title' => __('Cancel', 'pages'), 'class' => 'btn btn-default'));
?>
		</div>
		</form>
	</div>
</div>
<?php

if ($parent) {
    ?>
    <a href="<?php 
    echo Site::url() . '/' . $page['parent'];
    ?>
"><?php 
    echo $parent_page['title'];
    ?>
</a>&nbsp;<span>&rarr;</span>&nbsp;<a href="<?php 
    echo Site::url() . '/' . $page['parent'] . '/' . $page['slug'];
    ?>
"><?php 
    echo $page['title'];
    ?>
</a>
<?php 
} else {
    ?>
    <a href="<?php 
    echo Site::url() . '/' . $page['slug'];
    ?>
"><?php 
    echo $page['title'];
    ?>
</a>
<?php 
}
 /**
  * Get User login
  */
 public static function getLogin()
 {
     // Is User Loged in ?
     if (!Session::get('user_id')) {
         // Login Form Submit
         if (Request::post('login_submit')) {
             if (Cookie::get('login_attempts') && Cookie::get('login_attempts') >= 5) {
                 Notification::setNow('error', __('You are banned for 10 minutes. Try again later', 'users'));
             } else {
                 // Check csrf
                 if (Security::check(Request::post('csrf'))) {
                     $user = Users::$users->select("[login='******'username')) . "']", null);
                     if (count($user) !== 0) {
                         if ($user['login'] == Request::post('username')) {
                             if (trim($user['password']) == Security::encryptPassword(Request::post('password'))) {
                                 if ($user['role'] == 'admin' || $user['role'] == 'editor') {
                                     Session::set('admin', true);
                                 }
                                 Session::set('user_id', (int) $user['id']);
                                 Session::set('user_login', (string) $user['login']);
                                 Session::set('user_role', (string) $user['role']);
                                 Session::set('user_email', (string) $user['email']);
                                 Request::redirect(Site::url() . '/users/' . Session::get('user_id'));
                             } else {
                                 Notification::setNow('error', __('Wrong <b>username</b> or <b>password</b>', 'users'));
                                 if (Cookie::get('login_attempts')) {
                                     if (Cookie::get('login_attempts') < 5) {
                                         $attempts = Cookie::get('login_attempts') + 1;
                                         Cookie::set('login_attempts', $attempts, 600);
                                     } else {
                                         Notification::setNow('error', __('You are banned for 10 minutes. Try again later', 'users'));
                                     }
                                 } else {
                                     Cookie::set('login_attempts', 1, 600);
                                 }
                             }
                         }
                     } else {
                         Notification::setNow('error', __('Wrong <b>username</b> or <b>password</b>', 'users'));
                         if (Cookie::get('login_attempts')) {
                             if (Cookie::get('login_attempts') < 5) {
                                 $attempts = Cookie::get('login_attempts') + 1;
                                 Cookie::set('login_attempts', $attempts, 600);
                             } else {
                                 Notification::setNow('error', __('You are banned for 10 minutes. Try again later', 'users'));
                             }
                         } else {
                             Cookie::set('login_attempts', 1, 600);
                         }
                     }
                 } else {
                     die('Request was denied because it contained an invalid security token. Please refresh the page and try again.');
                 }
             }
         }
         View::factory('box/users/views/frontend/login')->display();
     } else {
         Request::redirect(Site::url() . '/users/' . Session::get('user_id'));
     }
 }
示例#8
0
文件: index.php 项目: Repkit/monstra
if (Session::exists('admin') && Session::get('admin') == true) {
    $is_admin = true;
} else {
    $is_admin = false;
}
// Logout user from system
if (Request::get('logout') && Request::get('logout') == 'do') {
    Session::destroy();
}
// If is admin then load admin area
if ($is_admin) {
    // If id is empty then redirect to default plugin PAGES
    if (Request::get('id')) {
        $area = Request::get('id');
    } else {
        Request::redirect(Site::url() . '/admin/index.php?id=dashboard');
    }
    $plugins_registered = Plugin::$plugins;
    foreach ($plugins_registered as $plugin) {
        $plugins_registered_areas[] = $plugin['id'];
    }
    // Show plugins admin area only for registered plugins
    if (in_array($area, $plugins_registered_areas)) {
        $plugin_admin_area = true;
    } else {
        $plugin_admin_area = false;
    }
    // Backend pre render
    Action::run('admin_pre_render');
    // Display admin template
    require 'themes' . DS . Option::get('theme_admin_name') . DS . 'index.template.php';