aboutsummaryrefslogtreecommitdiffstats
path: root/admin
diff options
context:
space:
mode:
authorrvelices <rv-github@modusoptimus.com>2007-01-25 02:18:56 +0000
committerrvelices <rv-github@modusoptimus.com>2007-01-25 02:18:56 +0000
commit80020dd7564f25f4af5d994df5690b1088456b41 (patch)
tree9f588b38e69054be1c5c4e01b899117c1863cc93 /admin
parent4472ba6ed4b6e079c6f98968354a3527f8af8ec8 (diff)
- user profiles available from admin page
- user creation from admin page with email (bug 514) - some language cleanup - small template enhancements - php syntax corrections (my mistake) git-svn-id: http://piwigo.org/svn/trunk@1753 68402e56-0260-453c-a942-63ccdbb3a9ee
Diffstat (limited to '')
-rw-r--r--admin/profile.php46
-rw-r--r--admin/user_list.php28
2 files changed, 51 insertions, 23 deletions
diff --git a/admin/profile.php b/admin/profile.php
new file mode 100644
index 000000000..0cf36e42c
--- /dev/null
+++ b/admin/profile.php
@@ -0,0 +1,46 @@
+<?php
+// +-----------------------------------------------------------------------+
+// | PhpWebGallery - a PHP based picture gallery |
+// | Copyright (C) 2002-2003 Pierrick LE GALL - pierrick@phpwebgallery.net |
+// | Copyright (C) 2003-2007 PhpWebGallery Team - http://phpwebgallery.net |
+// +-----------------------------------------------------------------------+
+// | branch : BSF (Best So Far)
+// | file : $Id$
+// | last update : $Date$
+// | last modifier : $Author$
+// | revision : $Revision$
+// +-----------------------------------------------------------------------+
+// | This program is free software; you can redistribute it and/or modify |
+// | it under the terms of the GNU General Public License as published by |
+// | the Free Software Foundation |
+// | |
+// | This program is distributed in the hope that it will be useful, but |
+// | WITHOUT ANY WARRANTY; without even the implied warranty of |
+// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
+// | General Public License for more details. |
+// | |
+// | You should have received a copy of the GNU General Public License |
+// | along with this program; if not, write to the Free Software |
+// | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, |
+// | USA. |
+// +-----------------------------------------------------------------------+
+
+if( !defined("PHPWG_ROOT_PATH") ) die ("Hacking attempt!");
+
+$edit_user = build_user( $_GET['user_id'], false );
+
+include_once(PHPWG_ROOT_PATH.'profile.php');
+
+
+save_profile_from_post( $edit_user, $errors);
+
+load_profile_in_template(
+ get_root_url().'admin.php?page=profile&amp;user_id='.$edit_user['id'],
+ get_root_url().'admin.php?page=user_list',
+ $edit_user
+ );
+$page['errors'] = array_merge( $page['errors'], $errors);
+
+$template->set_filename('profile', 'admin/profile.tpl');
+$template->assign_var_from_handle('ADMIN_CONTENT', 'profile');
+?>
diff --git a/admin/user_list.php b/admin/user_list.php
index 69d46e6d2..84efc057f 100644
--- a/admin/user_list.php
+++ b/admin/user_list.php
@@ -193,7 +193,8 @@ $page['direction_items'] = array(
if (isset($_POST['submit_add']))
{
- $page['errors'] = register_user($_POST['login'], $_POST['password'], '');
+ $page['errors'] = register_user(
+ $_POST['login'], $_POST['password'], $_POST['email']);
if (count($page['errors']) == 0)
{
@@ -455,25 +456,6 @@ else
$template->assign_vars(
array(
- 'L_AUTH_USER'=>$lang['permuser_only_private'],
- 'L_GROUP_ADD_USER' => $lang['group_add_user'],
- 'L_STATUS'=>$lang['user_status'],
- 'L_ORDER_BY' => $lang['order_by'],
- 'L_ACTIONS' => $lang['actions'],
- 'L_PROPERTIES' => $lang['properties'],
- 'L_PERMISSIONS' => $lang['permissions'],
- 'L_USERS_LIST' => $lang['title_liste_users'],
- 'L_NB_IMAGE_LINE' => $lang['nb_image_per_row'],
- 'L_NB_LINE_PAGE' => $lang['nb_row_per_page'],
- 'L_TEMPLATE' => $lang['theme'],
- 'L_RECENT_PERIOD' => $lang['recent_period'],
- 'L_EXPAND' => $lang['auto_expand'],
- 'L_SHOW_NB_COMMENTS' => $lang['show_nb_comments'],
- 'L_MAXWIDTH' => $lang['maxwidth'],
- 'L_MAXHEIGHT' => $lang['maxheight'],
- 'L_DELETE' => $lang['user_delete'],
- 'L_DELETE_HINT' => $lang['user_delete_hint'],
-
'U_HELP' => PHPWG_ROOT_PATH.'popuphelp.php?page=user_list',
'F_ADD_ACTION' => $base_url,
@@ -773,8 +755,8 @@ $template->assign_vars(array('NAVBAR' => $navbar));
// | user list |
// +-----------------------------------------------------------------------+
-$profile_url = PHPWG_ROOT_PATH.'admin.php?page=profile&amp;user_id=';
-$perm_url = PHPWG_ROOT_PATH.'admin.php?page=user_perm&amp;user_id=';
+$profile_url = get_root_url().'admin.php?page=profile&amp;user_id=';
+$perm_url = get_root_url().'admin.php?page=user_perm&amp;user_id=';
foreach ($page['filtered_users'] as $num => $local_user)
{
@@ -814,7 +796,7 @@ foreach ($page['filtered_users'] as $num => $local_user)
'CLASS' => ($num % 2 == 1) ? 'row2' : 'row1',
'ID' => $local_user['id'],
'CHECKED' => $checked,
- 'U_MOD' => $profile_url.$local_user['id'],
+ 'U_PROFILE' => $profile_url.$local_user['id'],
'U_PERM' => $perm_url.$local_user['id'],
'USERNAME' => $local_user['username'],
'STATUS' => $lang['user_status_'.$local_user['status']].(($local_user['adviser'] == 'true') ? ' ['.$lang['adviser'].']' : ''),