mirror of
https://github.com/Piwigo/Piwigo.git
synced 2025-04-26 19:29:58 +03:00
- ability to add users from administration panel
git-svn-id: http://piwigo.org/svn/trunk@741 68402e56-0260-453c-a942-63ccdbb3a9ee
This commit is contained in:
parent
72b4671ba9
commit
b3aff324b9
2 changed files with 40 additions and 21 deletions
33
profile.php
33
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)
|
||||
|
|
|
@ -1,3 +1,22 @@
|
|||
<!-- BEGIN errors -->
|
||||
<div class="errors">
|
||||
<ul>
|
||||
<!-- BEGIN error -->
|
||||
<li>{errors.error.ERROR}</li>
|
||||
<!-- END error -->
|
||||
</ul>
|
||||
</div>
|
||||
<!-- END errors -->
|
||||
|
||||
<!-- BEGIN add_user -->
|
||||
<div class="admin">{L_GROUP_ADD_USER}</div>
|
||||
<form method="post" name="post" action="{add_user.F_ACTION}">
|
||||
{L_USERNAME} <input type="text" name="login" maxlength="50" size="20" />
|
||||
{L_PASSWORD} <input type="text" name="password" />
|
||||
<input type="submit" name="submit_add" value="add" class="bouton" />
|
||||
</form>
|
||||
<!-- END add_user -->
|
||||
|
||||
<!-- BEGIN select_user -->
|
||||
<div class="admin">{L_SELECT_USERNAME}</div>
|
||||
<form method="post" name="post" action="{F_SEARCH_USER_ACTION}">
|
||||
|
@ -50,15 +69,6 @@
|
|||
<!-- BEGIN profile -->
|
||||
<div class="titrePage">{L_TITLE}</div>
|
||||
<!-- END profile -->
|
||||
<!-- BEGIN errors -->
|
||||
<div class="errors">
|
||||
<ul>
|
||||
<!-- BEGIN error -->
|
||||
<li>{modify.errors.error.ERROR}</li>
|
||||
<!-- END error -->
|
||||
</ul>
|
||||
</div>
|
||||
<!-- END errors -->
|
||||
<form method="post" action="{F_ACTION}">
|
||||
<table width="70%" align="center">
|
||||
<tr class="admin">
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue