20 include
'admin_header.php';
26 if (
$op ==
"editordelete" ) {
34 include_once
$GLOBALS[
'xoops']->path(
"/class/xoopsformloader.php" );
46 include_once
'../include/forms.php';
48 $obj->setGroups(array(XOOPS_GROUP_USERS) );
56 if ( in_array(XOOPS_GROUP_ADMIN, $obj->getGroups() ) && !in_array(XOOPS_GROUP_ADMIN,
$GLOBALS[
'xoopsUser']->getGroups() ) ) {
60 include_once
'../include/forms.php';
67 if ( !
$GLOBALS[
'xoopsSecurity']->check() ) {
94 $fieldname =
$fields[
$i]->getVar(
'field_name');
96 $default =
$fields[
$i]->getVar(
'field_default');
97 if ( $default ===
'' || $default === null)
continue;
98 $user->setVar($fieldname, $default);
102 $user->setVar(
'user_regdate', time() );
103 $user->setVar(
'level', 1);
108 if ( isset(
$_POST[
'level']) &&
$user->getVar(
'level') != intval(
$_POST[
'level']) ) {
112 if ( !empty(
$_POST[
'password']) ) {
116 } elseif (
$user->isNew() ) {
128 $fieldname =
$fields[
$i]->getVar(
'field_name');
129 if ( in_array(
$fields[$i]->getVar(
'field_id'), $editable_fields) && isset(
$_REQUEST[$fieldname]) ) {
132 $user->setVar($fieldname, $value);
135 $profile->setVar($fieldname, $value);
140 $new_groups = isset(
$_POST[
'groups']) ?
$_POST[
'groups'] : array();
146 include_once
$GLOBALS[
'xoops']->path(
"/modules/system/constants.php" );
149 $cur_groups =
$user->getGroups();
151 $added_groups = array_diff($new_groups, $cur_groups);
152 $removed_groups = array_diff($cur_groups, $new_groups);
154 if ( count($added_groups) > 0 ) {
155 foreach ($added_groups as $groupid ) {
159 if ( count($removed_groups) > 0 ) {
160 foreach ($removed_groups as $groupid ) {
161 $handler->removeUsersFromGroup($groupid, array(
$user->getVar(
'uid') ));
165 if (
$user->isNew() ) {
173 $user->setErrors($err);
176 $user->setGroups($new_groups);
177 include_once
'../include/forms.php';
178 echo
$user->getHtmlErrors();
189 if ( in_array(XOOPS_GROUP_ADMIN,
$groups) ) {
194 if ( !
$GLOBALS[
'xoopsSecurity']->check() ) {
203 echo $obj->getHtmlErrors();
215 include
'admin_footer.php';