public static function _index() { if ($_POST) { # beta code if ('DOTHEDEW' != $_POST['beta']) { return self::display_create('The beta code is not valid', $_POST); } $site_name = trim($_POST['site_name']); $email = trim($_POST['email']); if (empty($site_name) or empty($email)) { return self::display_create('The beta code is not valid', $_POST); } $theme = empty($_POST['theme']) ? 'base' : $_POST['theme']; # will redirect on success, else show error. $show_error = Site_Controller::_create_website($site_name, $theme, null, $email); return self::display_create($show_error, $_POST); } else { return self::display_create(); } }
public function new_website($page_name) { if (ROOTACCOUNT != $this->site_name) { die('return a 404 not found'); } if (!$_POST) { return $this->plusjade_dashboard($page_name, 'Nothing Sent.'); } $site_name = valid::filter_php_url(trim($_POST['site_name'])); $site = ORM::factory('site'); if ($site->subdomain_exists($site_name)) { return $this->plusjade_dashboard($page_name, 'site name already exists'); } # attempt to create the website $status = Site_Controller::_create_website($site_name, 'base', $this->account_user->get_user()->id); return $this->plusjade_dashboard($page_name, $status); }