示例#1
0
 public function create()
 {
     if ($test = User::find($_POST['username'], 'username')) {
         if (password_verify($_POST['password'], $test->password)) {
             $_SESSION['userid'] = $test->id;
             Functions::redirect('/clout/home');
         }
     }
     Functions::redirect(Settings::cloutURL());
 }
示例#2
0
 public function __construct()
 {
     if (GRAFT_CONFIG['DBHost'] == '' || GRAFT_CONFIG['DBName'] == '' || GRAFT_CONFIG['DBUser'] == '') {
         die('A database connection is required to run clout.');
     }
     // instance everything so the db gets setup
     // probably need a better way to do this
     // in the future #TODO
     \GraftPHP\Clout\Data::build();
     \GraftPHP\Clout\Field::build();
     \GraftPHP\Clout\FieldType::build();
     \GraftPHP\Clout\Record::build();
     \GraftPHP\Clout\Section::build();
     \GraftPHP\Clout\User::build();
     $this->data['sections'] = Section::all();
 }