mirror of
https://bitbucket.org/jsuto/piler.git
synced 2024-11-08 00:21:59 +01:00
added group handling feature
This commit is contained in:
parent
26807592b5
commit
e944852283
@ -11,7 +11,7 @@
|
||||
|
||||
#define PROGNAME "piler"
|
||||
|
||||
#define VERSION "0.1.18"
|
||||
#define VERSION "0.1.19"
|
||||
|
||||
#define PROGINFO VERSION ", Janos SUTO <sj@acts.hu>\n\n" CONFIGURE_PARAMS "\n"
|
||||
|
||||
|
@ -189,6 +189,7 @@ create index `user_settings_idx` on `user_settings`(`username`);
|
||||
drop table if exists `user`;
|
||||
create table if not exists `user` (
|
||||
`uid` int unsigned not null primary key,
|
||||
`gid` int default 0,
|
||||
`username` char(64) not null unique,
|
||||
`realname` char(64) default null,
|
||||
`password` char(48) default null,
|
||||
@ -197,7 +198,7 @@ create table if not exists `user` (
|
||||
`isadmin` tinyint default 0
|
||||
) Engine=InnoDB;
|
||||
|
||||
insert into `user` (`uid`, `username`, `realname`, `password`, `isadmin`, `domain`) values (0, 'admin', 'built-in piler admin', '$1$PItc7d$zsUgON3JRrbdGS11t9JQW1', 1, 'local');
|
||||
insert into `user` (`uid`, `gid`, `username`, `realname`, `password`, `isadmin`, `domain`) values (0, 0, 'admin', 'built-in piler admin', '$1$PItc7d$zsUgON3JRrbdGS11t9JQW1', 1, 'local');
|
||||
|
||||
drop table if exists `email`;
|
||||
create table if not exists `email` (
|
||||
@ -216,6 +217,19 @@ create table if not exists `email_groups` (
|
||||
) ENGINE=InnoDB;
|
||||
|
||||
|
||||
create table if not exists `group` (
|
||||
`id` bigint unsigned not null auto_increment primary key,
|
||||
`groupname` char(255) not null unique
|
||||
) ENGINE=InnoDB;
|
||||
|
||||
|
||||
create table if not exists `group_email` (
|
||||
`id` bigint unsigned not null,
|
||||
`email` char(128) not null,
|
||||
key `group_email_idx` (`id`)
|
||||
) ENGINE=InnoDB;
|
||||
|
||||
|
||||
create table if not exists `remote` (
|
||||
`remotedomain` char(64) not null primary key,
|
||||
`remotehost` char(64) not null,
|
||||
|
15
util/db-upgrade-0.18-vs-0.19.sql
Normal file
15
util/db-upgrade-0.18-vs-0.19.sql
Normal file
@ -0,0 +1,15 @@
|
||||
create table if not exists `group` (
|
||||
`id` bigint unsigned not null auto_increment primary key,
|
||||
`groupname` char(255) not null unique
|
||||
) ENGINE=InnoDB;
|
||||
|
||||
|
||||
create table if not exists `group_email` (
|
||||
`id` bigint unsigned not null,
|
||||
`email` char(128) not null,
|
||||
key `group_email_idx` (`id`)
|
||||
) ENGINE=InnoDB;
|
||||
|
||||
alter table `user` add column `gid` int default 0;
|
||||
|
||||
|
@ -80,6 +80,8 @@ define('DB_PASSWORD', 'piler');
|
||||
define('DB_DATABASE', 'piler');
|
||||
|
||||
define('TABLE_USER', 'user');
|
||||
define('TABLE_GROUP', 'group');
|
||||
define('TABLE_GROUP_EMAIL', 'group_email');
|
||||
define('TABLE_EMAIL', 'email');
|
||||
define('TABLE_META', 'metadata');
|
||||
define('TABLE_ATTACHMENT', 'attachment');
|
||||
|
84
webui/controller/group/add.php
Normal file
84
webui/controller/group/add.php
Normal file
@ -0,0 +1,84 @@
|
||||
<?php
|
||||
|
||||
|
||||
class ControllerGroupAdd extends Controller {
|
||||
private $error = array();
|
||||
private $domains = array();
|
||||
|
||||
public function index(){
|
||||
|
||||
$this->id = "content";
|
||||
$this->template = "group/add.tpl";
|
||||
$this->layout = "common/layout";
|
||||
|
||||
|
||||
$request = Registry::get('request');
|
||||
$db = Registry::get('db');
|
||||
|
||||
$this->load->model('group/group');
|
||||
|
||||
$this->document->title = $this->data['text_group_management'];
|
||||
|
||||
/* check if we are admin */
|
||||
|
||||
if(Registry::get('admin_user') == 1) {
|
||||
|
||||
if($this->request->server['REQUEST_METHOD'] == 'POST') {
|
||||
$ret = 0;
|
||||
|
||||
if($this->validate() == true){
|
||||
$ret = $this->model_group_group->add_group($this->request->post);
|
||||
|
||||
if($ret == 1){
|
||||
$this->data['x'] = $this->data['text_successfully_added'];
|
||||
} else {
|
||||
$this->data['errorstring'] = $this->data['text_failed_to_add'] . ": " . $ret;
|
||||
}
|
||||
}
|
||||
else {
|
||||
$this->data['errorstring'] = array_pop($this->error);
|
||||
}
|
||||
|
||||
if($ret == 0) {
|
||||
|
||||
//$this->data['post'] = $this->request->post;
|
||||
//$this->data['next_group_id'] = $this->model_group_group->getNextUid();
|
||||
|
||||
}
|
||||
}
|
||||
else {
|
||||
//$this->data['next_group_id'] = $this->model_group_group->getNextUid();
|
||||
}
|
||||
}
|
||||
else {
|
||||
$this->template = "common/error.tpl";
|
||||
$this->data['errorstring'] = $this->data['text_you_are_not_admin'];
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
$this->render();
|
||||
}
|
||||
|
||||
|
||||
private function validate() {
|
||||
|
||||
if(!isset($this->request->post['groupname'])) {
|
||||
$this->error['group'] = $this->data['text_missing_data'];
|
||||
}
|
||||
|
||||
|
||||
if (!$this->error) {
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
?>
|
104
webui/controller/group/edit.php
Normal file
104
webui/controller/group/edit.php
Normal file
@ -0,0 +1,104 @@
|
||||
<?php
|
||||
|
||||
|
||||
class ControllerGroupEdit extends Controller {
|
||||
private $error = array();
|
||||
private $domains = array();
|
||||
|
||||
public function index(){
|
||||
$this->data['id'] = 0;
|
||||
|
||||
$this->id = "content";
|
||||
$this->template = "group/edit.tpl";
|
||||
$this->layout = "common/layout";
|
||||
|
||||
|
||||
$request = Registry::get('request');
|
||||
$db = Registry::get('db');
|
||||
$language = Registry::get('language');
|
||||
|
||||
$this->load->model('group/group');
|
||||
|
||||
|
||||
$this->document->title = $language->get('text_group_management');
|
||||
|
||||
$this->data['domains'] = array();
|
||||
|
||||
|
||||
if(isset($this->request->get['id']) && is_numeric($this->request->get['id']) && $this->request->get['id'] > 0) {
|
||||
$this->data['id'] = $this->request->get['id'];
|
||||
}
|
||||
|
||||
if(isset($this->request->post['id']) && is_numeric($this->request->post['id']) && $this->request->post['id'] > 0) {
|
||||
$this->data['id'] = $this->request->post['id'];
|
||||
}
|
||||
|
||||
|
||||
/* check if we are admin */
|
||||
|
||||
if(Registry::get('admin_user') == 1) {
|
||||
|
||||
if($this->request->server['REQUEST_METHOD'] == 'POST') {
|
||||
if($this->validate() == true){
|
||||
|
||||
$ret = $this->model_group_group->update_group($this->request->post);
|
||||
|
||||
if($ret == 1){
|
||||
$this->data['x'] = $this->data['text_successfully_modified'];
|
||||
} else {
|
||||
$this->template = "common/error.tpl";
|
||||
$this->data['errorstring'] = $this->data['text_failed_to_modify'] . ": " . $ret;
|
||||
}
|
||||
|
||||
//$__groupname = $this->request->post['groupname'];
|
||||
}
|
||||
else {
|
||||
$this->template = "common/error.tpl";
|
||||
$this->data['errorstring'] = array_pop($this->error);
|
||||
}
|
||||
}
|
||||
else {
|
||||
$this->data['group'] = $this->model_group_group->get_domain_by_id($this->data['id']);
|
||||
$this->data['email'] = $this->model_group_group->get_emails_by_group_id($this->data['id']);
|
||||
|
||||
//$this->data['user']['group_membership'] = $this->model_user_user->get_additional_uids($this->data['uid']);
|
||||
//$this->data['emails'] = $this->model_user_user->getEmails($this->data['user']['username']);
|
||||
|
||||
}
|
||||
}
|
||||
else {
|
||||
$this->template = "common/error.tpl";
|
||||
$this->data['errorstring'] = $this->data['text_you_are_not_admin'];
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
$this->render();
|
||||
}
|
||||
|
||||
|
||||
private function validate() {
|
||||
|
||||
if(!isset($this->request->post['groupname'])) {
|
||||
$this->error['group'] = $this->data['text_missing_data'];
|
||||
}
|
||||
|
||||
if(!isset($this->request->post['id']) || !is_numeric($this->request->post['id']) || (int)$this->request->post['id'] < 0) {
|
||||
$this->error['id'] = $this->data['text_invalid_data'];
|
||||
}
|
||||
|
||||
|
||||
if (!$this->error) {
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
?>
|
85
webui/controller/group/list.php
Normal file
85
webui/controller/group/list.php
Normal file
@ -0,0 +1,85 @@
|
||||
<?php
|
||||
|
||||
|
||||
class ControllerGroupList extends Controller {
|
||||
private $error = array();
|
||||
|
||||
public function index(){
|
||||
|
||||
$this->id = "content";
|
||||
$this->template = "group/list.tpl";
|
||||
$this->layout = "common/layout";
|
||||
|
||||
|
||||
$request = Registry::get('request');
|
||||
$db = Registry::get('db');
|
||||
$language = Registry::get('language');
|
||||
|
||||
$this->load->model('group/group');
|
||||
|
||||
$this->document->title = $language->get('text_group_management');
|
||||
|
||||
|
||||
$this->data['page'] = 0;
|
||||
$this->data['page_len'] = get_page_length();
|
||||
|
||||
$this->data['total_users'] = 0;
|
||||
|
||||
$users = array();
|
||||
|
||||
|
||||
/* get search term if there's any */
|
||||
|
||||
if($this->request->server['REQUEST_METHOD'] == 'POST'){
|
||||
$this->data['search'] = @$this->request->post['search'];
|
||||
}
|
||||
else {
|
||||
$this->data['search'] = @$this->request->get['search'];
|
||||
}
|
||||
|
||||
/* get page */
|
||||
|
||||
if(isset($this->request->get['page']) && is_numeric($this->request->get['page']) && $this->request->get['page'] > 0) {
|
||||
$this->data['page'] = $this->request->get['page'];
|
||||
}
|
||||
|
||||
|
||||
$this->data['sort'] = 'groupname';
|
||||
|
||||
$this->data['order'] = (int)@$this->request->get['order'];
|
||||
|
||||
if(@$this->request->get['sort'] == "uid") { $this->data['sort'] = "uid"; }
|
||||
if(@$this->request->get['sort'] == "realname") { $this->data['sort'] = "realname"; }
|
||||
if(@$this->request->get['sort'] == "email") { $this->data['sort'] = "email"; }
|
||||
if(@$this->request->get['sort'] == "domain") { $this->data['sort'] = "domain"; }
|
||||
if(@$this->request->get['sort'] == "policy") { $this->data['sort'] = "policy_group"; }
|
||||
|
||||
|
||||
/* check if we are admin */
|
||||
|
||||
if(Registry::get('admin_user') == 1) {
|
||||
|
||||
$this->data['groups'] = $this->model_group_group->get_groups($this->data['search'], $this->data['page'], $this->data['page_len'],
|
||||
$this->data['sort'], $this->data['order']);
|
||||
|
||||
$this->data['total_groups'] = $this->model_group_group->count_groups($this->data['search']);
|
||||
}
|
||||
else {
|
||||
$this->template = "common/error.tpl";
|
||||
$this->data['errorstring'] = $this->data['text_you_are_not_admin'];
|
||||
}
|
||||
|
||||
|
||||
$this->data['prev_page'] = $this->data['page'] - 1;
|
||||
$this->data['next_page'] = $this->data['page'] + 1;
|
||||
|
||||
$this->data['total_pages'] = floor($this->data['total_users'] / $this->data['page_len']);
|
||||
|
||||
|
||||
$this->render();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
?>
|
76
webui/controller/group/remove.php
Normal file
76
webui/controller/group/remove.php
Normal file
@ -0,0 +1,76 @@
|
||||
<?php
|
||||
|
||||
|
||||
class ControllerGroupRemove extends Controller {
|
||||
private $error = array();
|
||||
private $domains = array();
|
||||
private $d = array();
|
||||
|
||||
public function index(){
|
||||
|
||||
$this->id = "content";
|
||||
$this->template = "group/remove.tpl";
|
||||
$this->layout = "common/layout";
|
||||
|
||||
|
||||
$request = Registry::get('request');
|
||||
$db = Registry::get('db');
|
||||
|
||||
$this->load->model('group/group');
|
||||
|
||||
$this->document->title = $this->data['text_group_management'];
|
||||
|
||||
|
||||
$this->data['username'] = Registry::get('username');
|
||||
|
||||
$this->data['id'] = (int)@$this->request->get['id'];
|
||||
$this->data['group'] = @$this->request->get['group'];
|
||||
$this->data['confirmed'] = (int)@$this->request->get['confirmed'];
|
||||
|
||||
|
||||
if($this->validate() == true) {
|
||||
|
||||
if($this->data['confirmed'] == 1) {
|
||||
$ret = $this->model_group_group->delete_group($this->data['id']);
|
||||
if($ret == 1){
|
||||
$this->data['x'] = $this->data['text_successfully_removed'];
|
||||
}
|
||||
else {
|
||||
$this->data['x'] = $this->data['text_failed_to_remove'];
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
$this->template = "common/error.tpl";
|
||||
$this->data['errorstring'] = array_pop($this->error);
|
||||
}
|
||||
|
||||
|
||||
|
||||
$this->render();
|
||||
}
|
||||
|
||||
|
||||
private function validate() {
|
||||
|
||||
if(Registry::get('admin_user') == 0) {
|
||||
$this->error['admin'] = $this->data['text_you_are_not_admin'];
|
||||
}
|
||||
|
||||
if(!isset($this->request->get['id']) || !is_numeric($this->request->get['id']) || $this->request->get['id'] < 1 ) {
|
||||
$this->error['groupname'] = $this->data['text_invalid_data'];
|
||||
}
|
||||
|
||||
|
||||
if (!$this->error) {
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
?>
|
@ -16,6 +16,7 @@ class ControllerUserAdd extends Controller {
|
||||
$db = Registry::get('db');
|
||||
|
||||
$this->load->model('user/user');
|
||||
$this->load->model('group/group');
|
||||
|
||||
$this->document->title = $this->data['text_user_management'];
|
||||
|
||||
@ -59,6 +60,7 @@ class ControllerUserAdd extends Controller {
|
||||
}
|
||||
else {
|
||||
$this->data['next_user_id'] = $this->model_user_user->getNextUid();
|
||||
$this->data['groups'] = $this->model_group_group->get_groups();
|
||||
}
|
||||
}
|
||||
else {
|
||||
|
@ -19,6 +19,7 @@ class ControllerUserEdit extends Controller {
|
||||
$language = Registry::get('language');
|
||||
|
||||
$this->load->model('user/user');
|
||||
$this->load->model('group/group');
|
||||
|
||||
|
||||
$this->document->title = $language->get('text_user_management');
|
||||
@ -69,7 +70,8 @@ class ControllerUserEdit extends Controller {
|
||||
}
|
||||
}
|
||||
else {
|
||||
$this->data['user'] = $this->model_user_user->getUserByUid($this->data['uid']);
|
||||
$this->data['user'] = $this->model_user_user->get_user_by_uid($this->data['uid']);
|
||||
$this->data['groups'] = $this->model_group_group->get_groups();
|
||||
|
||||
$this->data['user']['group_membership'] = $this->model_user_user->get_additional_uids($this->data['uid']);
|
||||
|
||||
|
@ -7,6 +7,7 @@ $_['text_ad_sync_status'] = "AD synchronisation status";
|
||||
$_['text_add'] = "Add";
|
||||
$_['text_add_new_email_address'] = "New email address";
|
||||
$_['text_add_new_domain'] = "New domain";
|
||||
$_['text_add_new_group'] = "Add group";
|
||||
$_['text_add_new_rule'] = "Add rule";
|
||||
$_['text_add_new_user_alias'] = "Add new user";
|
||||
$_['text_add_policy'] = "Add new policy";
|
||||
@ -88,6 +89,7 @@ $_['text_exact_domain_name_or_email_address'] = "exact domain name or email addr
|
||||
$_['text_exclude'] = "Exclude";
|
||||
$_['text_existing_domains'] = "Existing domains";
|
||||
$_['text_existing_email'] = "Existing email";
|
||||
$_['text_existing_groups'] = "Existing groups";
|
||||
$_['text_existing_policies'] = "Existing policies";
|
||||
$_['text_existing_rules'] = "Existing rules";
|
||||
$_['text_existing_user'] = "Existing user";
|
||||
@ -109,6 +111,9 @@ $_['text_from'] = "From";
|
||||
$_['text_from_domain'] = "From domain";
|
||||
|
||||
$_['text_group_id'] = "Group id";
|
||||
$_['text_groupname'] = "Group name";
|
||||
$_['text_groups'] = "Groups";
|
||||
$_['text_group_management'] = "Group management";
|
||||
$_['text_group_membership'] = "Group membership";
|
||||
|
||||
$_['text_health'] = "Health";
|
||||
@ -220,6 +225,7 @@ $_['text_remove_selected_uids'] = "Remove selected uids";
|
||||
$_['text_remove_policy'] = "Remove policy";
|
||||
$_['text_remove_rule'] = "Remove rule";
|
||||
$_['text_remove_this_policy'] = "Remove this policy";
|
||||
$_['text_remove_this_group'] = "Remove this group";
|
||||
$_['text_remove_this_user'] = "Remove this user";
|
||||
$_['text_reset_counters'] = "Reset counters";
|
||||
$_['text_restore_message'] = "restore message";
|
||||
@ -286,6 +292,7 @@ $_['text_unknown'] = "unknown";
|
||||
$_['text_update_selected_uids'] = "Update selected uids";
|
||||
$_['text_uptime'] = "Uptime";
|
||||
$_['text_user'] = "User";
|
||||
$_['text_users'] = "Users";
|
||||
$_['text_user_id'] = "User id";
|
||||
$_['text_user_auditor'] = "Auditor";
|
||||
$_['text_user_domainadmin'] = "Domain admin";
|
||||
|
@ -7,6 +7,7 @@ $_['text_ad_sync_status'] = "AD szinkroniz
|
||||
$_['text_add'] = "Felvesz";
|
||||
$_['text_add_new_email_address'] = "Új email cím";
|
||||
$_['text_add_new_domain'] = "Új domain";
|
||||
$_['text_add_new_group'] = "Új csoport";
|
||||
$_['text_add_new_rule'] = "Új szabály";
|
||||
$_['text_add_new_user_alias'] = "Új felhasználó";
|
||||
$_['text_add_policy'] = "Új házirend";
|
||||
@ -88,6 +89,7 @@ $_['text_exact_domain_name_or_email_address'] = "pontos domainn
|
||||
$_['text_exclude'] = "Kihagy";
|
||||
$_['text_existing_domains'] = "Létező domainek";
|
||||
$_['text_existing_email'] = "Létező email";
|
||||
$_['text_existing_groups'] = "Létezõ csoportok";
|
||||
$_['text_existing_policies'] = "Létező házirendek";
|
||||
$_['text_existing_rules'] = "Létező szabályok";
|
||||
$_['text_existing_user'] = "Létező felhasználó";
|
||||
@ -115,6 +117,9 @@ $_['text_history'] = "T
|
||||
$_['text_home'] = "Kezdőlap";
|
||||
|
||||
$_['text_group_id'] = "Csoport azonosító";
|
||||
$_['text_groupname'] = "Csoportnév";
|
||||
$_['text_groups'] = "Csoportok";
|
||||
$_['text_group_management'] = "Csoport";
|
||||
$_['text_group_membership'] = "Csoport tagság";
|
||||
|
||||
$_['text_image'] = "kép";
|
||||
@ -220,6 +225,7 @@ $_['text_remove_message2'] = "lev
|
||||
$_['text_remove_selected_uids'] = "Kijelölt azonosítók törlése";
|
||||
$_['text_remove_policy'] = "Házirend törlése";
|
||||
$_['text_remove_rule'] = "Szabály törlése";
|
||||
$_['text_remove_this_group'] = "Csoport törlése";
|
||||
$_['text_remove_this_policy'] = "Házirend törlése";
|
||||
$_['text_remove_this_user'] = "Felhasználó törlése";
|
||||
$_['text_reset_counters'] = "Számlálók nullázása";
|
||||
@ -287,6 +293,7 @@ $_['text_unauthorized_view_message'] = "jogosulatlan
|
||||
$_['text_update_selected_uids'] = "Kijelölt azonosítók módosítása";
|
||||
$_['text_uptime'] = "Uptime";
|
||||
$_['text_user'] = "Felhasználó";
|
||||
$_['text_users'] = "Felhasználók";
|
||||
$_['text_user_id'] = "Felhasználó azonosító";
|
||||
$_['text_user_auditor'] = "Auditor";
|
||||
$_['text_user_domainadmin'] = "Domain admin";
|
||||
|
@ -7,6 +7,7 @@ $_['text_ad_sync_status'] = "AD szinkronizáció státusz";
|
||||
$_['text_add'] = "Felvesz";
|
||||
$_['text_add_new_email_address'] = "Új email cím";
|
||||
$_['text_add_new_domain'] = "Új domain";
|
||||
$_['text_add_new_group'] = "Új csoport";
|
||||
$_['text_add_new_rule'] = "Új szabály";
|
||||
$_['text_add_new_user_alias'] = "Új felhasználó";
|
||||
$_['text_add_policy'] = "Új házirend";
|
||||
@ -88,6 +89,7 @@ $_['text_exact_domain_name_or_email_address'] = "pontos domainnév vagy email c
|
||||
$_['text_exclude'] = "Kihagy";
|
||||
$_['text_existing_domains'] = "Létező domainek";
|
||||
$_['text_existing_email'] = "Létező email";
|
||||
$_['text_existing_groups'] = "Létező csoportok";
|
||||
$_['text_existing_policies'] = "Létező házirendek";
|
||||
$_['text_existing_rules'] = "Létező szabályok";
|
||||
$_['text_existing_user'] = "Létező felhasználó";
|
||||
@ -115,6 +117,9 @@ $_['text_history'] = "Történet";
|
||||
$_['text_home'] = "Kezdőlap";
|
||||
|
||||
$_['text_group_id'] = "Csoport azonosító";
|
||||
$_['text_groupname'] = "Csoportnév";
|
||||
$_['text_groups'] = "Csoportok";
|
||||
$_['text_group_management'] = "Csoport";
|
||||
$_['text_group_membership'] = "Csoport tagság";
|
||||
|
||||
$_['text_image'] = "kép";
|
||||
@ -220,6 +225,7 @@ $_['text_remove_message2'] = "levél törlése";
|
||||
$_['text_remove_selected_uids'] = "Kijelölt azonosítók törlése";
|
||||
$_['text_remove_policy'] = "Házirend törlése";
|
||||
$_['text_remove_rule'] = "Szabály törlése";
|
||||
$_['text_remove_this_group'] = "Csoport törlése";
|
||||
$_['text_remove_this_policy'] = "Házirend törlése";
|
||||
$_['text_remove_this_user'] = "Felhasználó törlése";
|
||||
$_['text_reset_counters'] = "Számlálók nullázása";
|
||||
@ -287,6 +293,7 @@ $_['text_unauthorized_view_message'] = "jogosulatlan üzenet megtekintés";
|
||||
$_['text_update_selected_uids'] = "Kijelölt azonosítók módosítása";
|
||||
$_['text_uptime'] = "Uptime";
|
||||
$_['text_user'] = "Felhasználó";
|
||||
$_['text_users'] = "Felhasználók";
|
||||
$_['text_user_id'] = "Felhasználó azonosító";
|
||||
$_['text_user_auditor'] = "Auditor";
|
||||
$_['text_user_domainadmin'] = "Domain admin";
|
||||
|
145
webui/model/group/group.php
Normal file
145
webui/model/group/group.php
Normal file
@ -0,0 +1,145 @@
|
||||
<?php
|
||||
|
||||
class ModelGroupGroup extends Model {
|
||||
|
||||
|
||||
public function get_groups($search = '', $page = 0, $page_len = 0, $sort = 'groupname', $order = 0) {
|
||||
$where_cond = '';
|
||||
$_order = "";
|
||||
$groups = array();
|
||||
$Q = array();
|
||||
$limit = "";
|
||||
|
||||
$from = (int)$page * (int)$page_len;
|
||||
|
||||
$search = preg_replace("/\s{1,}/", "", $search) . '%';
|
||||
|
||||
if($search){
|
||||
$where_cond .= " WHERE `groupname` like ?";
|
||||
array_push($Q, $search);
|
||||
}
|
||||
|
||||
/* sort order */
|
||||
|
||||
if($order == 0) { $order = "ASC"; }
|
||||
else { $order = "DESC"; }
|
||||
|
||||
$_order = "ORDER BY `$sort` $order";
|
||||
|
||||
if($page_len > 0) { $limit = " LIMIT " . (int)$from . ", " . (int)$page_len; }
|
||||
|
||||
$query = $this->db->query("SELECT `id`, `groupname` FROM `" . TABLE_GROUP . "` $where_cond $_order $limit", $Q);
|
||||
|
||||
foreach ($query->rows as $q) {
|
||||
|
||||
$groups[] = array(
|
||||
'id' => $q['id'],
|
||||
'groupname' => $q['groupname']
|
||||
);
|
||||
}
|
||||
|
||||
return $groups;
|
||||
}
|
||||
|
||||
|
||||
public function get_emails_by_group_id($id = 0) {
|
||||
$emails = '';
|
||||
|
||||
$query = $this->db->query("SELECT `email` FROM `" . TABLE_GROUP_EMAIL . "` WHERE id=?", array($id));
|
||||
|
||||
foreach ($query->rows as $q) {
|
||||
$emails .= $q['email'] . "\n";
|
||||
}
|
||||
|
||||
return preg_replace("/\n$/", "", $emails);
|
||||
}
|
||||
|
||||
|
||||
public function count_groups($search = '') {
|
||||
$where_cond = "";
|
||||
$Q = array();
|
||||
|
||||
$search = preg_replace("/\s{1,}/", "", $search) . '%';
|
||||
|
||||
if($search){
|
||||
$where_cond .= " WHERE `groupname` like '?'";
|
||||
array_push($Q, $search);
|
||||
}
|
||||
|
||||
$query = $this->db->query("SELECT COUNT(*) AS num FROM `" . TABLE_GROUP . "` $where_cond", $Q);
|
||||
|
||||
return $query->num_rows;
|
||||
}
|
||||
|
||||
|
||||
public function add_group($group = array()) {
|
||||
|
||||
if(!isset($group['groupname']) || $group['groupname'] == "") { return -1; }
|
||||
|
||||
$query = $this->db->query("INSERT INTO `" . TABLE_GROUP . "` (groupname) VALUES(?)", array($group['groupname']) );
|
||||
|
||||
if($query->error == 1 || $this->db->countAffected() == 0){ return $group['groupname']; }
|
||||
|
||||
$gid = $this->db->getLastId();
|
||||
|
||||
$emails = explode("\n", $group['email']);
|
||||
foreach ($emails as $email) {
|
||||
$email = rtrim($email);
|
||||
if(validemail($email)) {
|
||||
$query = $this->db->query("INSERT INTO `" . TABLE_GROUP_EMAIL . "` (id, email) VALUES(?,?)", array($gid, $email));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
LOGGER("add group: " . $group['groupname'] . ", id=" . (int)$gid);
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
public function update_group($group = array()) {
|
||||
LOGGER("update user: " . $group['groupname'] . ", id=" . (int)$group['id']);
|
||||
|
||||
$query = $this->db->query("UPDATE `" . TABLE_GROUP . "` SET `groupname`=? WHERE id=?", array($group['groupname'], (int)$group['id']));
|
||||
|
||||
$query = $this->db->query("DELETE FROM `" . TABLE_GROUP_EMAIL . "` WHERE id=?", array($group['id']));
|
||||
|
||||
$emails = explode("\n", $group['email']);
|
||||
foreach ($emails as $email) {
|
||||
$email = rtrim($email);
|
||||
|
||||
if(validemail($email)) {
|
||||
$query = $this->db->query("INSERT INTO `" . TABLE_GROUP_EMAIL . "` (id, email) VALUES(?,?)", array($group['id'], $email));
|
||||
}
|
||||
}
|
||||
|
||||
return $this->db->countAffected();
|
||||
}
|
||||
|
||||
|
||||
public function get_domain_by_id($id = 0) {
|
||||
if(!is_numeric($id) || (int)$id < 0){
|
||||
return array();
|
||||
}
|
||||
|
||||
$query = $this->db->query("SELECT * FROM `" . TABLE_GROUP . "` WHERE id=?", array((int)$id));
|
||||
|
||||
return $query->row;
|
||||
}
|
||||
|
||||
|
||||
public function delete_group($id = 0) {
|
||||
|
||||
$query = $this->db->query("DELETE FROM `" . TABLE_GROUP_EMAIL . "` WHERE id=?", array($id));
|
||||
|
||||
$query = $this->db->query("DELETE FROM `" . TABLE_GROUP . "` WHERE id=?", array((int)$id));
|
||||
|
||||
LOGGER("remove group: id=$id");
|
||||
|
||||
return $this->db->countAffected();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
?>
|
@ -4,7 +4,7 @@ class ModelUserAuth extends Model {
|
||||
|
||||
public function checkLogin($username = '', $password = '') {
|
||||
|
||||
$query = $this->db->query("SELECT " . TABLE_USER . ".username, " . TABLE_USER . ".uid, " . TABLE_USER . ".realname, " . TABLE_USER . ".dn, " . TABLE_USER . ".password, " . TABLE_USER . ".isadmin, " . TABLE_USER . ".domain FROM " . TABLE_USER . ", " . TABLE_EMAIL . " WHERE " . TABLE_EMAIL . ".email=? AND " . TABLE_EMAIL . ".uid=" . TABLE_USER . ".uid", array($username));
|
||||
$query = $this->db->query("SELECT " . TABLE_USER . ".username, " . TABLE_USER . ".uid, " . TABLE_USER . ".gid, " . TABLE_USER . ".realname, " . TABLE_USER . ".dn, " . TABLE_USER . ".password, " . TABLE_USER . ".isadmin, " . TABLE_USER . ".domain FROM " . TABLE_USER . ", " . TABLE_EMAIL . " WHERE " . TABLE_EMAIL . ".email=? AND " . TABLE_EMAIL . ".uid=" . TABLE_USER . ".uid", array($username));
|
||||
|
||||
if(!isset($query->row['password'])) { return 0; }
|
||||
|
||||
@ -14,12 +14,13 @@ class ModelUserAuth extends Model {
|
||||
|
||||
$_SESSION['username'] = $query->row['username'];
|
||||
$_SESSION['uid'] = $query->row['uid'];
|
||||
$_SESSION['gid'] = $query->row['gid'];
|
||||
$_SESSION['admin_user'] = $query->row['isadmin'];
|
||||
$_SESSION['email'] = $username;
|
||||
$_SESSION['domain'] = $query->row['domain'];
|
||||
$_SESSION['realname'] = $query->row['realname'];
|
||||
|
||||
$_SESSION['emails'] = $this->model_user_user->get_users_all_email_addresses($query->row['uid']);
|
||||
$_SESSION['emails'] = $this->model_user_user->get_users_all_email_addresses($query->row['uid'], $query->row['gid']);
|
||||
|
||||
AUDIT(ACTION_LOGIN, $username, '', '', 'successful auth against user table');
|
||||
|
||||
|
@ -57,7 +57,7 @@ class ModelUserUser extends Model {
|
||||
}
|
||||
|
||||
|
||||
public function get_users_all_email_addresses($uid = 0) {
|
||||
public function get_users_all_email_addresses($uid = 0, $gid = 0) {
|
||||
$data = array();
|
||||
$uids = $uid;
|
||||
|
||||
@ -79,6 +79,15 @@ class ModelUserUser extends Model {
|
||||
|
||||
}
|
||||
|
||||
|
||||
$query = $this->db->query("SELECT email FROM `" . TABLE_GROUP_EMAIL . "` WHERE id=?", array($gid));
|
||||
|
||||
if(isset($query->rows)) {
|
||||
foreach ($query->rows as $q) {
|
||||
if(!in_array($email, $data)) { array_push($data, $q['email']); }
|
||||
}
|
||||
}
|
||||
|
||||
return $data;
|
||||
}
|
||||
|
||||
@ -150,7 +159,7 @@ class ModelUserUser extends Model {
|
||||
}
|
||||
|
||||
|
||||
public function getUserByUid($uid = 0) {
|
||||
public function get_user_by_uid($uid = 0) {
|
||||
if(!is_numeric($uid) || (int)$uid < 0){
|
||||
return array();
|
||||
}
|
||||
@ -209,13 +218,14 @@ class ModelUserUser extends Model {
|
||||
|
||||
if($page_len > 0) { $limit = " LIMIT " . (int)$from . ", " . (int)$page_len; }
|
||||
|
||||
$query = $this->db->query("SELECT " . TABLE_USER . ".uid, isadmin, username, realname, domain, email FROM " . TABLE_USER . "," . TABLE_EMAIL . " $where_cond group by " . TABLE_USER . ".uid $_order $limit");
|
||||
$query = $this->db->query("SELECT " . TABLE_USER . ".uid, gid, isadmin, username, realname, domain, email FROM " . TABLE_USER . "," . TABLE_EMAIL . " $where_cond group by " . TABLE_USER . ".uid $_order $limit");
|
||||
|
||||
foreach ($query->rows as $q) {
|
||||
|
||||
if(Registry::get('admin_user') == 1 || (isset($q['domain']) && $q['domain'] == $my_domain[0]) ) {
|
||||
$users[] = array(
|
||||
'uid' => $q['uid'],
|
||||
'gid' => $q['gid'],
|
||||
'username' => $q['username'],
|
||||
'realname' => $q['realname'],
|
||||
'domain' => isset($q['domain']) ? $q['domain'] : "",
|
||||
@ -313,7 +323,7 @@ class ModelUserUser extends Model {
|
||||
|
||||
$encrypted_password = crypt($user['password']);
|
||||
|
||||
$query = $this->db->query("INSERT INTO " . TABLE_USER . " (uid, username, realname, password, domain, dn, isadmin) VALUES(?,?,?,?,?,?,?)", array((int)$user['uid'], $user['username'], $user['realname'], $encrypted_password, $user['domain'], @$user['dn'], (int)$user['isadmin']));
|
||||
$query = $this->db->query("INSERT INTO " . TABLE_USER . " (uid, gid, username, realname, password, domain, dn, isadmin) VALUES(?,?,?,?,?,?,?,?)", array((int)$user['uid'], (int)$user['gid'], $user['username'], $user['realname'], $encrypted_password, $user['domain'], @$user['dn'], (int)$user['isadmin']));
|
||||
|
||||
if($query->error == 1 || $this->db->countAffected() == 0){ return $user['username']; }
|
||||
|
||||
@ -377,7 +387,7 @@ class ModelUserUser extends Model {
|
||||
if($this->db->countAffected() != 1) { return 0; }
|
||||
}
|
||||
|
||||
$query = $this->db->query("UPDATE " . TABLE_USER . " SET username=?, realname=?, domain=?, dn=?, isadmin=? WHERE uid=?", array($user['username'], $user['realname'], $user['domain'], @$user['dn'], $user['isadmin'], (int)$user['uid']));
|
||||
$query = $this->db->query("UPDATE " . TABLE_USER . " SET username=?, realname=?, domain=?, gid=?, dn=?, isadmin=? WHERE uid=?", array($user['username'], $user['realname'], $user['domain'], $user['gid'], @$user['dn'], $user['isadmin'], (int)$user['uid']));
|
||||
|
||||
|
||||
/* first, remove all his email addresses */
|
||||
|
@ -25,7 +25,8 @@
|
||||
|
||||
<li class="search_li" style="font: 11px normal Arial, sans-serif;"><a class="hide" href="#"<?php if(strstr($_SERVER['QUERY_STRING'], "domain/") || ($_SERVER['QUERY_STRING'] != "route=user/settings" && strstr($_SERVER['QUERY_STRING'], "user/")) || strstr($_SERVER['QUERY_STRING'], "policy/") || strstr($_SERVER['QUERY_STRING'], "import/")) { ?> id="active"<?php } ?>><?php print $text_administration; ?></a>
|
||||
<ul class="sub_menu">
|
||||
<li><a href="index.php?route=user/list"><?php print $text_user_management; ?></a></li>
|
||||
<li><a href="index.php?route=user/list"><?php print $text_users; ?></a></li>
|
||||
<li><a href="index.php?route=group/list"><?php print $text_groups; ?></a></li>
|
||||
<li><a href="index.php?route=domain/domain"><?php print $text_domain; ?></a></li>
|
||||
<li><a href="index.php?route=policy/archiving"><?php print $text_archiving_rules; ?></a></li>
|
||||
<li><a href="index.php?route=policy/retention"><?php print $text_retention_rules; ?></a></li>
|
||||
|
35
webui/view/theme/default/templates/group/add.tpl
Normal file
35
webui/view/theme/default/templates/group/add.tpl
Normal file
@ -0,0 +1,35 @@
|
||||
|
||||
<h4><?php print $text_add_new_group; ?></h4>
|
||||
|
||||
<?php if(isset($errorstring)){ ?><p class="loginfailed"><?php print $text_error; ?>: <?php print $errorstring; ?></p><?php } ?>
|
||||
|
||||
|
||||
<form action="index.php?route=group/add" name="adduser" method="post" autocomplete="off">
|
||||
|
||||
<div id="ss1">
|
||||
|
||||
<div class="domainrow">
|
||||
<div class="domaincell"><?php print $text_groupname; ?>:</div>
|
||||
<div class="domaincell"><input type="text" name="groupname" value="<?php if(isset($post['groupname'])){ print $post['groupname']; } ?>" class="text" /></div>
|
||||
</div>
|
||||
|
||||
<div class="domainrow">
|
||||
<div class="domaincell"><?php print $text_email_addresses; ?>:</div>
|
||||
<div class="domaincell"><textarea style="height:280px;" name="email" class="domain"><?php if(isset($post['email'])){ print $post['email']; } ?></textarea></div>
|
||||
</div>
|
||||
|
||||
<div class="domainrow">
|
||||
<div class="domaincell"> </div>
|
||||
<div class="domaincell"><input type="submit" value="<?php print $text_add; ?>" /><input type="reset" value="<?php print $text_cancel; ?>" /></div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
</form>
|
||||
|
||||
|
||||
<?php if(isset($x)){ print $x; ?>. <a href="index.php?route=group/list"><?php print $text_back; ?></a>
|
||||
<?php } ?>
|
||||
|
39
webui/view/theme/default/templates/group/edit.tpl
Normal file
39
webui/view/theme/default/templates/group/edit.tpl
Normal file
@ -0,0 +1,39 @@
|
||||
|
||||
|
||||
<?php if(isset($group)) { ?>
|
||||
|
||||
<form action="index.php?route=group/edit" name="addgroup" method="post" autocomplete="off">
|
||||
<input type="hidden" name="id" value="<?php print $id; ?>" />
|
||||
|
||||
<div id="ss1">
|
||||
|
||||
<div class="domainrow">
|
||||
<div class="domaincell"><?php print $text_groupname; ?>:</div>
|
||||
<div class="domaincell"><input type="text" name="groupname" value="<?php print $group['groupname']; ?>" class="text" /></div>
|
||||
</div>
|
||||
|
||||
<div class="domainrow">
|
||||
<div class="domaincell"><?php print $text_email_addresses; ?>:</div>
|
||||
<div class="domaincell"><textarea style="height:280px;" name="email" class="domain"><?php if(isset($email)){ print $email; } ?></textarea></div>
|
||||
</div>
|
||||
|
||||
<div class="domainrow">
|
||||
<div class="domaincell"> </div>
|
||||
<div class="domaincell"><input type="submit" value="<?php print $text_modify; ?>" /><input type="reset" value="<?php print $text_cancel; ?>" /></div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
</form>
|
||||
|
||||
<p> </p>
|
||||
<p><a href="index.php?route=group/remove&id=<?php print $group['id']; ?>&group=<?php print $group['groupname']; ?>"><?php print $text_remove_this_group; ?>: <?php print $group['groupname']; ?></a></p>
|
||||
<p> </p>
|
||||
|
||||
<p>
|
||||
<?php } else if(isset($x)){ print $x; ?>.
|
||||
<?php } ?>
|
||||
|
||||
<a href="index.php?route=group/list"><?php print $text_back; ?></a>
|
||||
</p>
|
57
webui/view/theme/default/templates/group/list.tpl
Normal file
57
webui/view/theme/default/templates/group/list.tpl
Normal file
@ -0,0 +1,57 @@
|
||||
|
||||
<p/>
|
||||
|
||||
<p><a href="index.php?route=group/add"><?php print $text_add_new_group; ?></a></p>
|
||||
|
||||
<h4><?php print $text_existing_groups; ?></h4>
|
||||
|
||||
<form method="post" name="search1" action="index.php?route=group/list">
|
||||
<input type="text" name="search" value="<?php print $search; ?>" />
|
||||
<input type="submit" value="<?php print $text_search; ?>" />
|
||||
</form>
|
||||
|
||||
|
||||
<p> </p>
|
||||
|
||||
<?php if(isset($groups) && count($groups) > 0){ ?>
|
||||
|
||||
<div id="pagenav">
|
||||
<?php if($page > 0){ ?><a href="index.php?route=group/list&page=0&search=<?php print $search; ?>&sort=<?php print $sort; ?>&order=<?php print $order; ?>" class="navlink"><?php } ?> « <?php if($page > 0){ ?></a><?php } ?>
|
||||
<?php if($page > 0){ ?><a href="index.php?route=group/list&page=<?php print $prev_page; ?>&search=<?php print $search; ?>&sort=<?php print $sort; ?>&order=<?php print $order; ?>" class="navlink"><?php } ?> ‹ <?php if($page > 0){ ?></a><?php } ?>
|
||||
<?php print $groups[0][$sort]; ?> - <?php print $groups[count($groups)-1][$sort]; ?>
|
||||
<?php if($total_groups >= $page_len*($page+1) && $total_groups > $page_len){ ?><a href="index.php?route=group/list&page=<?php print $next_page; ?>&search=<?php print $search; ?>&sort=<?php print $sort; ?>&order=<?php print $order; ?>" class="navlink"><?php } ?> › <?php if($total_groups >= $page_len*($page+1) && $total_groups > $page_len){ ?></a><?php } ?>
|
||||
<?php if($page < $total_pages){ ?><a href="index.php?route=group/list&page=<?php print $total_pages; ?>&search=<?php print $search; ?>&sort=<?php print $sort; ?>&order=<?php print $order; ?>" class="navlink"><?php } ?> » <?php if($page < $total_pages){ ?></a><?php } ?>
|
||||
</div>
|
||||
|
||||
|
||||
<div id="ss1" style="margin-top: 10px;">
|
||||
<div class="domainrow">
|
||||
<div class="domaincell"><?php print $text_groupname; ?> <a href="index.php?route=group/list&sort=groupname&order=0"><img src="<?php print ICON_ARROW_UP; ?>" border="0"></a> <a href="index.php?route=group/list&sort=groupname&order=1"><img src="<?php print ICON_ARROW_DOWN; ?>" border="0"></a></div>
|
||||
<div class="domaincell"> </div>
|
||||
</div>
|
||||
|
||||
<?php foreach($groups as $group) { ?>
|
||||
<div class="domainrow">
|
||||
<div class="domaincell"><?php print $group['groupname']; ?></div>
|
||||
<div class="domaincell"><a href="index.php?route=group/edit&id=<?php print $group['id']; ?>"><?php print $text_edit_or_view; ?></a></div>
|
||||
</div>
|
||||
<?php } ?>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<div id="pagenav">
|
||||
<?php if($page > 0){ ?><a href="index.php?route=group/list&page=0&search=<?php print $search; ?>&sort=<?php print $sort; ?>&order=<?php print $order; ?>" class="navlink"><?php } ?> « <?php if($page > 0){ ?></a><?php } ?>
|
||||
<?php if($page > 0){ ?><a href="index.php?route=group/list&page=<?php print $prev_page; ?>&search=<?php print $search; ?>&sort=<?php print $sort; ?>&order=<?php print $order; ?>" class="navlink"><?php } ?> ‹ <?php if($page > 0){ ?></a><?php } ?>
|
||||
<?php print $groups[0][$sort]; ?> - <?php print $groups[count($groups)-1][$sort]; ?>
|
||||
<?php if($total_groups >= $page_len*($page+1) && $total_groups > $page_len){ ?><a href="index.php?route=group/list&page=<?php print $next_page; ?>&search=<?php print $search; ?>&sort=<?php print $sort; ?>&order=<?php print $order; ?>" class="navlink"><?php } ?> › <?php if($total_groups >= $page_len*($page+1) && $total_groups > $page_len){ ?></a><?php } ?>
|
||||
<?php if($page < $total_pages){ ?><a href="index.php?route=group/list&page=<?php print $total_pages; ?>&search=<?php print $search; ?>&sort=<?php print $sort; ?>&order=<?php print $order; ?>" class="navlink"><?php } ?> » <?php if($page < $total_pages){ ?></a><?php } ?>
|
||||
</div>
|
||||
|
||||
|
||||
<?php } else { ?>
|
||||
<?php print $text_not_found; ?>
|
||||
<?php } ?>
|
||||
|
||||
|
13
webui/view/theme/default/templates/group/remove.tpl
Normal file
13
webui/view/theme/default/templates/group/remove.tpl
Normal file
@ -0,0 +1,13 @@
|
||||
|
||||
<p>
|
||||
|
||||
<?php if($confirmed){ ?>
|
||||
|
||||
<?php print $x; ?>. <a href="index.php?route=group/list"><?php print $text_back; ?></a>
|
||||
|
||||
<?php } else { ?>
|
||||
<a href="index.php?route=group/remove&id=<?php print $id; ?>&group=<?php print $group; ?>&confirmed=1"><?php print $text_remove_this_group; ?>: <?php print $group; ?></a>
|
||||
<?php } ?>
|
||||
|
||||
</p>
|
||||
|
@ -34,6 +34,20 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="domainrow">
|
||||
<div class="domaincell"><?php print $text_groups; ?>:</div>
|
||||
<div class="domaincell">
|
||||
<select name="gid">
|
||||
<option value="0"<?php if(isset($post) && $post['gid'] == 0){ ?> selected="selected"<?php } ?>>-</option>
|
||||
<?php foreach ($groups as $group) { ?>
|
||||
<option value="<?php print $group['id']; ?>"<?php if(isset($post) && $post['gid'] == $group['id']){ ?> selected="selected"<?php } ?>><?php print $group['groupname']; ?></option>
|
||||
<?php } ?>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<?php if(ENABLE_LDAP_IMPORT_FEATURE == 1) { ?>
|
||||
<div class="domainrow">
|
||||
<div class="domaincell">LDAP DN:</div>
|
||||
|
@ -34,6 +34,19 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="domainrow">
|
||||
<div class="domaincell"><?php print $text_groups; ?>:</div>
|
||||
<div class="domaincell">
|
||||
<select name="gid">
|
||||
<option value="0"<?php if($user['gid'] == 0){ ?> selected="selected"<?php } ?>>-</option>
|
||||
<?php foreach ($groups as $group) { ?>
|
||||
<option value="<?php print $group['id']; ?>"<?php if($user['gid'] == $group['id']){ ?> selected="selected"<?php } ?>><?php print $group['groupname']; ?></option>
|
||||
<?php } ?>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<?php if(ENABLE_LDAP_IMPORT_FEATURE == 1) { ?>
|
||||
<div class="domainrow">
|
||||
<div class="domaincell">LDAP DN:</div>
|
||||
|
Loading…
Reference in New Issue
Block a user