From e6a313f0ce599e14f2d6c55c8080582f0d539d10 Mon Sep 17 00:00:00 2001 From: vincent-peugnet Date: Sun, 23 Dec 2018 20:14:08 +0100 Subject: admin connect --- app/class/application.php | 58 +++++++++++++++++++++++++++++++++++++---------- 1 file changed, 46 insertions(+), 12 deletions(-) (limited to 'app/class/application.php') diff --git a/app/class/application.php b/app/class/application.php index 4926a1b..d75df51 100644 --- a/app/class/application.php +++ b/app/class/application.php @@ -2,8 +2,13 @@ class Application { + /** + * @var Modeluser + */ + protected $usermanager; + public function __construct() { - + $this->usermanager = new Modeluser(); } public function wakeup() @@ -21,22 +26,33 @@ class Application header('Location: ./'); exit; } + } elseif(isset($_POST['userinit'])) { + $userdata = $_POST['userinit']; + $userdata['level'] = 10; + $user = new User($userdata); + $this->usermanager->add($user); + header('Location: ./'); + exit; + } else { if(Config::readconfig()) { - if(!Config::checkbasepath() || empty(Config::admin()) || empty(Config::arttable())) { + if(!Config::checkbasepath() || empty(Config::arttable())) { echo ''; $this->configform(); exit; + } else { + if(!$this->usermanager->adminexist()) { + echo 'missing admin user'; + $this->adminform(); + exit; + } } } else { echo 'Missing config file'; @@ -64,18 +80,36 @@ class Application

Leave it empty if W-CMS is in your root folder, otherwise, indicate the subfolder(s) in witch you installed the CMS

+

+ +

+ +

Set the name of the first folder that is going to store all your work

+
+ + + + + +

- +

- -

The main password for administration, you can change it later.

+ +

Your user id as the first administrator.

+

- +

- -

Set the name of the first folder that is going to store all your work

+ +

Your user passworder as first administrator.

-- cgit v1.2.3