From b3aff324b9943e9f32e3f0a4e6be49d4cad0ee48 Mon Sep 17 00:00:00 2001 From: plegall Date: Sun, 13 Feb 2005 19:53:07 +0000 Subject: - ability to add users from administration panel git-svn-id: http://piwigo.org/svn/trunk@741 68402e56-0260-453c-a942-63ccdbb3a9ee --- profile.php | 33 +++++++++++++++++++++------------ template/default/profile.tpl | 28 +++++++++++++++++++--------- 2 files changed, 40 insertions(+), 21 deletions(-) diff --git a/profile.php b/profile.php index 28a7af672..a36fdbc74 100644 --- a/profile.php +++ b/profile.php @@ -208,6 +208,11 @@ UPDATE '.USERS_TABLE.' } } } +else if (defined('IN_ADMIN') and IN_ADMIN and isset($_POST['submit_add'])) +{ + $errors = register_user($_POST['login'], $_POST['password'], + $_POST['password'], ''); +} // +-----------------------------------------------------------------------+ // | page header and options | // +-----------------------------------------------------------------------+ @@ -227,9 +232,10 @@ $template->set_filenames(array('profile_body'=>'profile.tpl')); if (defined('IN_ADMIN') and IN_ADMIN and empty($userdata)) { - $template->assign_block_vars('select_user',array()); - $admin_profile = add_session_id(PHPWG_ROOT_PATH.'admin.php?page=profile'); + + $template->assign_block_vars('add_user', array('F_ACTION'=>$admin_profile)); + $template->assign_block_vars('select_user',array()); $conf['users_page'] = 20; $start = isset($_GET['start']) ? $_GET['start'] : 0; @@ -253,9 +259,11 @@ SELECT COUNT(*) AS counter 'L_LOOKUP_USER'=>$lang['Look_up_user'], 'L_FIND_USERNAME'=>$lang['Find_username'], 'L_AUTH_USER'=>$lang['permuser_only_private'], + 'L_GROUP_ADD_USER' => $lang['group_add_user'], 'L_SUBMIT'=>$lang['submit'], 'L_STATUS'=>$lang['user_status'], 'L_USERNAME' => $lang['login'], + 'L_PASSWORD' => $lang['password'], 'L_EMAIL' => $lang['mail_address'], 'L_ORDER_BY' => $lang['order_by'], 'L_ACTIONS' => $lang['actions'], @@ -426,16 +434,6 @@ else $url_return = PHPWG_ROOT_PATH.'category.php?'.$_SERVER['QUERY_STRING']; $template->assign_vars(array('U_RETURN' => add_session_id($url_return))); } -//-------------------------------------------------------------- errors display - if (count($errors) != 0) - { - $template->assign_block_vars('modify.errors',array()); - foreach ($errors as $error) - { - $template->assign_block_vars('modify.errors.error', - array('ERROR'=>$error)); - } - } //------------------------------------------------------------- user management if (defined('IN_ADMIN') and IN_ADMIN) { @@ -465,6 +463,17 @@ else } } // +-----------------------------------------------------------------------+ +// | errors display | +// +-----------------------------------------------------------------------+ +if (count($errors) != 0) +{ + $template->assign_block_vars('errors',array()); + foreach ($errors as $error) + { + $template->assign_block_vars('errors.error', array('ERROR'=>$error)); + } +} +// +-----------------------------------------------------------------------+ // | html code display | // +-----------------------------------------------------------------------+ if (defined('IN_ADMIN') and IN_ADMIN) diff --git a/template/default/profile.tpl b/template/default/profile.tpl index 79f15764e..ad6619c37 100644 --- a/template/default/profile.tpl +++ b/template/default/profile.tpl @@ -1,3 +1,22 @@ + +
+ +
+ + + +
{L_GROUP_ADD_USER}
+
+ {L_USERNAME} + {L_PASSWORD} + +
+ +
{L_SELECT_USERNAME}
@@ -50,15 +69,6 @@
{L_TITLE}
- -
-
    - -
  • {modify.errors.error.ERROR}
  • - -
-
- -- cgit v1.2.3