From 57092eea2be73abd93dc1ac8427f33a749da78ae Mon Sep 17 00:00:00 2001 From: Theo Weijmer Date: Sun, 31 Dec 2017 10:13:05 +0100 Subject: [PATCH] ucase --- ...Controller.php => ExternalsController.php} | 2 +- .../controllers/beheer/usersController.php | 99 ------------------- application/views/pages/externals_view.php | 70 +++++++++++++ 3 files changed, 71 insertions(+), 100 deletions(-) rename application/controllers/beheer/{customersController.php => ExternalsController.php} (96%) delete mode 100644 application/controllers/beheer/usersController.php create mode 100644 application/views/pages/externals_view.php diff --git a/application/controllers/beheer/customersController.php b/application/controllers/beheer/ExternalsController.php similarity index 96% rename from application/controllers/beheer/customersController.php rename to application/controllers/beheer/ExternalsController.php index fe40206..949a8fd 100644 --- a/application/controllers/beheer/customersController.php +++ b/application/controllers/beheer/ExternalsController.php @@ -6,7 +6,7 @@ * Time: 10:11 */ -class customersController extends MY_Controller { +class externalsControllerController extends MY_Controller { public function __construct() { diff --git a/application/controllers/beheer/usersController.php b/application/controllers/beheer/usersController.php deleted file mode 100644 index 26da539..0000000 --- a/application/controllers/beheer/usersController.php +++ /dev/null @@ -1,99 +0,0 @@ -load->model( $models ); - $this->load->library( $libraries ); - } - - public function index() - { - - } - - public function getAllUsers( $archive = 'F' ) - { - $users = User::getAllUsers( $archive ); - - $this->json( $users ); - } - - public function saveUser() - { - $userValidation = new UserValidation(); - - if ( ! $userValidation->getValidationResult() ) - return $this->json( [ - 'success' => FALSE, 'messages' => $userValidation->getErrorMessages()] ); - - $user = $this->input->post(); - - $userID = $user['id']; - unset( $user['id'] ); - - if ( $userID == 0 ) $user = $this->newUser( $user ); - - $user['role'] = empty( $user['role'] ) ? NULL : $user['role']; - - $userID = User::saveUser( $userID, $user ); - - $this->json( ['success' => TRUE, 'userID' => $userID] ); - } - - public function archiveUser( $userID, $status ) - { - User::whereId( $userID )->update( ['archive' => $status] ); - } - - public function removeUser( $userID ) - { - $removeUser = new RemoveUser( $userID ); - - if ( $removeUser->getAllowDelete() === FALSE ) return $this->json( ['result' => FALSE] ); - - User::removeUser( $userID ); - - $this->json( ['result' => TRUE] ); - } - - private function newUser( $user ) - { - $userCreation = new UserCreation( $user ); - - $user = $userCreation->getUser(); - - $password = $userCreation->getPassword(); - - $this->sendWelcomeEmail( $user, $password ); - - return $user; - } - - private function sendWelcomeEmail( $user, $password ) - { - $this->load->library( 'email' ); - - $html = $this->load->view( 'emails/welcome_email', [ - 'password' => $password, 'user' => $user], TRUE ); - - $this->email->from( 'noreply@debeleidsonderzoekers.nl', 'DBOIS' ); - $this->email->to( $user['email'] ); - $this->email->subject( 'Wachtwoord DBOIS' ); - $this->email->message( $html ); - - $this->email->send(); - } -} \ No newline at end of file diff --git a/application/views/pages/externals_view.php b/application/views/pages/externals_view.php new file mode 100644 index 0000000..eaca882 --- /dev/null +++ b/application/views/pages/externals_view.php @@ -0,0 +1,70 @@ +
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
contactnaamadresplaatsemailtarief 
+ + + + + + + + + +
+ + +
+ +
+
+ + +
+
+
+
+
+
+
\ No newline at end of file