bludit/bl-kernel/admin/controllers/add-user.php

34 lines
1.2 KiB
PHP
Raw Normal View History

2015-05-05 03:00:01 +02:00
<?php defined('BLUDIT') or die('Bludit CMS.');
2015-05-15 00:07:45 +02:00
// ============================================================================
// Check role
// ============================================================================
if($Login->role()!=='admin') {
2015-07-20 05:14:12 +02:00
Alert::set($Language->g('you-do-not-have-sufficient-permissions'));
2015-05-15 00:07:45 +02:00
Redirect::page('admin', 'dashboard');
}
2015-05-05 03:00:01 +02:00
// ============================================================================
// Functions
// ============================================================================
2015-08-03 02:49:12 +02:00
// ============================================================================
// Main before POST
// ============================================================================
2015-05-05 03:00:01 +02:00
// ============================================================================
// POST Method
// ============================================================================
if( $_SERVER['REQUEST_METHOD'] == 'POST' )
{
2017-07-05 23:30:30 +02:00
if( createUser($_POST) ) {
Redirect::page('users');
2015-05-05 03:00:01 +02:00
}
}
2015-05-15 00:07:45 +02:00
// ============================================================================
2015-08-03 02:49:12 +02:00
// Main after POST
2015-05-15 00:07:45 +02:00
// ============================================================================