示例#1
0
 public static function CheckSiteUrl()
 {
     if (isset($_SERVER['SERVER_PROTOCOL'])) {
         if (Options::GetDomain(Options::get('siteurl')) != Options::GetDomain(CurrentPath())) {
             die(base64_decode("SXQgc2VlbXMgdGhhdCB5b3UgYXJlIHVzaW5nIGEgZGlmZmVyZW50IGRvbWFpbiwgWW91IG5lZWQgdG8gcmUtaW5zdGFsbCB0aGUgYXBwbGljYXRpb24uPGJyLz5JZiB5b3UgdGhpbmsgeW91J3JlIHNlZWluZyB0aGlzIGJ5IG1pc3Rha2UsIHBsZWFzZSBsZXQgdXMga25vdy4gc3VwcG9ydEBraW5ncG9zdGVyLm5ldA=="));
         }
     }
 }
示例#2
0
<?php

/*
|--------------------------------------------------------------------------
| Common init file
|--------------------------------------------------------------------------
|
*/
require_once "core/commoninit.php";
require_once "core/language/language.php";
$user = new user();
if ($user->isLoggedIn()) {
    $user->logout();
    Redirect::to(CurrentPath());
    die;
}
?>
</body>
</html>
<!DOCTYPE html>
<html>
<head>

<meta http-equiv='Content-Type' content='text/html; charset=UTF-8' />

<title><?php 
echo Options::get("sitename");
?>
 | <?php 
echo lang('ACCOUNT_RECOVERY');
?>
示例#3
0
/*
|-------------------------------------------------------------------
| Check if the form has been submited
|-------------------------------------------------------------------
|
*/
if (Input::get('setup')) {
    $db = DB::GetInstance();
    $validate = new Validate();
    $validation = $validate->check($_POST, array('username' => array('disp_text' => 'Username', 'required' => true, 'min' => 2, 'max' => 32, 'unique' => 'users'), 'password' => array('disp_text' => 'Password', 'required' => true, 'min' => 6, 'max' => 32), 'repassword' => array('disp_text' => 'Confirm Password', 'required' => true, 'matches' => 'password'), 'email' => array('disp_text' => 'E-mail', 'required' => true, 'unique' => 'users', 'valid_email' => true), 'sitename' => array('disp_text' => 'Site name', 'required' => true)));
    if ($validation->passed()) {
        $salt = Hash::salt(32);
        try {
            $user = new user();
            $user->create(array('username' => Input::get('username'), 'password' => Hash::make(Input::get('password'), $salt), 'salt' => $salt, 'email' => Input::get('email'), 'roles' => '1', 'active' => '1', 'signup' => date('Y-m-d H:i:s')));
            $siteurl = substr(CurrentPath(), 0, strrpos(CurrentPath(), 'install/'));
            $db->query("INSERT INTO `options` (`option`,`value`) values ('siteurl', ? )", array($siteurl));
            $db->query("INSERT INTO `options` (`option`,`value`) values ('sitename', ? )", array(Input::get('sitename')));
            $db->query("INSERT INTO `options` (`option`,`value`) values ('users_can_register', '1' )");
            $db->query("INSERT INTO `options` (`option`,`value`) values ('users_must_confirm_email', '0' )");
            // Setup the cron jobs (Evry 5 min by default)
            $output = shell_exec('crontab -l');
            $cron_file = "/tmp/crontab.txt";
            $cmd = "* * * * * wget -O /dev/null " . $siteurl . "cron.php >/dev/null 2>&1";
            file_put_contents($cron_file, $output . $cmd . PHP_EOL);
            exec("crontab {$cron_file}");
            Redirect::To("../index.php");
        } catch (Exception $e) {
            die($e->getMessage());
        }
    }