Sorry, but that user does not exist.

Makes it possible for admin to create users from admin panel
Forum rules
The content in this forum is dated Dec. 21 2005 and can be used as Archive only. This Forum is LOCKED and READ ONLY !

Postby leecovuk on Thu 23. Jun, 2005 19:07

hello everyone,

Really hoping for help here;

I have the same problems as featured in this thread, but the suggested code fix hasn't worked for me. I still get 'user does not exist'.
I am using phpBB 2.0.15 and I suspect one or more other mods are clashing with this one;
Maybe either 'Country Flags' or 'Account Self Delete' which both seem to be working fine.

I am attaching the 2 instruction files for Country Flags and Account Self Delete, in a real hope that someone can tell me how to get everything working together.
Alternatively, if you think there isn't a problem with these 3 mods working together, please ask me to show you any relevant phpBB files from my installation.

Thankyou; I really need help here to sort this out.

Lee
leecovuk
Poster
Poster
 
Posts: 3
Joined: Wed 25. May, 2005 04:15

Postby Fors on Sat 27. Aug, 2005 20:49

cool
Fors
Poster
Poster
 
Posts: 1
Joined: Sat 27. Aug, 2005 20:46

Postby Yugioh on Sun 04. Sep, 2005 21:12

:D
Yugioh
Poster
Poster
 
Posts: 4
Joined: Fri 01. Apr, 2005 18:45

Postby matt555 on Tue 13. Sep, 2005 20:15

I am also having this same error message, only I just upgraded to phpbb 2.0.17, and had the mod working fine in version 2.0.4. I really need to get this fixed. I am going to start fresh with the four required files and try to edit the required files again. Can anyone offer me any ideas?
Thank You
matt555
Poster
Poster
 
Posts: 1
Joined: Sun 11. Sep, 2005 23:43

Postby Beeveer on Mon 19. Sep, 2005 08:50

Many have working this mod correctly in 2.0.17, so you have somewhere made a mistake.
Nee, ik geef geen antwoorden in het Nederlands, die horen thuis op www.phpbb.nl ;)
User avatar
Beeveer
brilliant supporter
 
Posts: 264
Joined: Tue 30. Nov, 2004 19:13
Location: Boskoop, South-Holland, the Netherlands

Postby runman on Tue 04. Oct, 2005 21:24

i hav e run it wit EM, but also got this problem with this mod???

What's the solution?
runman
Poster
Poster
 
Posts: 2
Joined: Sat 19. Mar, 2005 14:07

Postby leecovuk on Fri 11. Nov, 2005 18:23

hello Niels and everyone,

I don't understand enough about Easymod and valid mod actions to be able to understand why the error featured in this topic appears;
however, I think I have re-written this mod so that it reads more simply;
It appears to work via Easymod on phpBB 2.0.18 but I would be grateful if someone could confirm my version below is exactly right for a 'clean' un-mod'ed phpbb 2.0.18.

Many thanks,
Lee
[code]
##############################################################
## MOD Title: Admin_add_users
## MOD Author: Niels < ncr@db9.dk > (Niels Chr. Rød) http://mods.db9.dk
## MOD Description: Admin can now create a new user, using admin panel
## user management. In file admin_users.php is defined
## witch user should be used as "standard", so you may
## configure what default settings new users will have.
## MOD Version: 0.10.5 Beta
## Compatibility: 2.0.5->2.0.6
##
## Installation Level: Easy
## Installation Time: 3 Minutes (1mn by EasyMOD of Nuttzy)
## Files To Edit: 4
## admin/admin_users.php
## language/lang_english/lang_admin.php
## templates/subSilver/admin/user_edit_body.tpl
## templates/subSilver/admin/user_select_body.tpl
##
## Included Files: 0
##
##############################################################
## For Security Purposes, Please Check: http://www.phpbb.com/mods/ for the
## latest version of this MOD. Downloading this MOD from other sites could cause malicious code
## to enter into your phpBB Forum. As such, phpBB will not offer support for MOD's not offered
## in our MOD-Database, located at: http://www.phpbb.com/mods/
##############################################################
## Author Notes:
##
## 1. Full MOD description
## -----------
## Admin can now create a new user, using admin panel user management.
## In file admin_users.php is defined witch user should be used as
## "standard", so you may configure what default settings new users
## will have.
## This also support the usergroups, so makeing the "default" user
## member of some usergroups, will make all new users created from
## ACP members of the same usergroups.
## The default password is also hardcoded into this file (look in
## the top of the file) - admin may of course overwrite this, when
## creating the users.
##
## 2. EasyMOD
## -----------
## This MOD is compatible and can be installed by EasyMOD
## of Nuttzy (but is not officially EasyMOD Compliant)!
## http://area51.phpbb.com/phpBB22/viewforum.php?sid=&f=15
##
## However, on alpha releases of EM and meanwhile beta or
## final release some actions are NOT performed.
## You'll have to do them manually !
##
## 2.1 Translation are not managed
## -----------
## EM can not already manage actions for any other
## language than English (but language intructions are proceed
## to all installed languages in order to prevent errors).
## So the translations provided with this MOD must be installed
## manually if you need them.
##
## 3. Official last version link
## -----------
## Meanwhile the phpBB group validation and as the MOD is not yet
## in the phpBB MOD database, check this official link for updates...
## http://mods.db9.dk/viewtopic.php?t=1475
##
##############################################################
## MOD History:
##
## 2004-05-04 - Version 0.10.5
## - corrected EM compatible isue in admin_users.php
##
## 2004-24-03 - Version 0.10.4
## - corrected a bug in 0.10.3, as the FIND tag wasen't good
##
## 2004-03-03 - Version 0.10.3
## - Changed a find tag, to clearify, what to find
##
## 2003-12-05 - Version 0.10.2
## - fix a isue wih new users and password
## 2003-12-05 - Version 0.10.1
## - phpBB template & EasyMOD compliance enhancement
## - Fix 2 instruction errors
## - Add delimiters for the MOD code inserted
##
## 2003-08-05 - Version 0.10.0
## - complete re-write of the mod
## - support a "user template", witch make it posible to
## define how standart users should be set up
## - you may define a "standart" password
## - new users become members of the same usergroups as
## the standart user
## - admin may "cancel" the creation of the user, as long
## as not submitted
## - works toghether with protect user account mod
## (force user to change password)
## - EM ready
##
## ????-??-?? - Version 0.9.2
## - change for 2.0.6. + made compt. with attachemt mod
##
## ????-??-?? - Version 0.9.1
## - corrected that add button was showen into user permission
## page as well
##
## ????-??-?? - Version 0.9.0
## - Initial release
##
##############################################################
## Before Adding This MOD To Your Forum, You Should Back Up All Files Related To This MOD
##############################################################
#
#-----[ OPEN ]------------------------------------------------
#
admin/admin_users.php

#
#-----[ FIND ]------------------------------------------------
#
define('IN_PHPBB', 1);

#
#-----[ AFTER, ADD ]------------------------------------------
#

// Start add - Admin add user MOD
// define a "dummy user", the profile settings of this user, will be used as default settings for new users
define('DEFAULT_USER_ID', 2);
define('DEFAULT_PASSWD', '123456');
// End add - Admin add user MOD

#
#-----[ FIND ]------------------------------------------------
#
//
// Begin program

#
#-----[ BEFORE, ADD ]-----------------------------------------
#

// Start add - Admin add user MOD
$new_user = (isset($HTTP_POST_VARS['new_user'])) ? (($HTTP_POST_VARS['new_user']==TRUE) ? TRUE : 0 ) : 0 ;
if ($new_user)
{
//see if user already exist
if (get_userdata($HTTP_POST_VARS['username']))
{
message_die(GENERAL_MESSAGE, $lang['Username_taken'] );
}
//see if default user exist
if ( !($default_user = get_userdata(DEFAULT_USER_ID) ) )
{
message_die(CRITICAL_MESSAGE, 'The DEFAULT_USER_ID are not set correctly, please correct this in admin/admin_users.php');
}
if ($mode == 'save' && isset( $HTTP_POST_VARS['submit'] ) )
{
//we need to create the user
$sql = "SELECT MAX(user_id) AS total
FROM " . USERS_TABLE;
if ( !($result = $db->sql_query($sql)) )
{
message_die(GENERAL_ERROR, 'Could not obtain next user_id information', '', __LINE__, __FILE__, $sql);
}
if ( !($row = $db->sql_fetchrow($result)) )
{
message_die(GENERAL_ERROR, 'Could not obtain next user_id information', '', __LINE__, __FILE__, $sql);
}
$user_id = $row['total'] + 1;
$sql = "INSERT INTO " . USERS_TABLE . " (user_id, username, user_regdate, user_active)
VALUES ($user_id, 'new_user', " . time() . ",'0')";
if ( !($result = $db->sql_query($sql, BEGIN_TRANSACTION)) )
{
message_die(GENERAL_ERROR, 'Could not insert data into users table', '', __LINE__, __FILE__, $sql);
}
$sql = "INSERT INTO " . GROUPS_TABLE . " (group_name, group_description, group_single_user, group_moderator)
VALUES ('', 'Personal User', 1, 0)";
if ( !($result = $db->sql_query($sql)) )
{
message_die(GENERAL_ERROR, 'Could not insert data into groups table', '', __LINE__, __FILE__, $sql);
}
$group_id = $db->sql_nextid();
//go get the usergroups, the default user are member of
$sql = "SELECT g.group_id
FROM " . USER_GROUP_TABLE . " ug, " . GROUPS_TABLE . " g
WHERE NOT g.group_single_user AND ug.group_id=g.group_id AND ug.user_id='".DEFAULT_USER_ID."'";
if ( !($result = $db->sql_query($sql)) )
{
message_die(GENERAL_ERROR, 'Could not obtain default user group information', '', __LINE__, __FILE__, $sql);
}
while ($group_data = $db->sql_fetchrow($result))
{
//user join default groups
$sql = "INSERT INTO " . USER_GROUP_TABLE . " (group_id, user_id, user_pending)
VALUES (".$group_data['group_id'].", $user_id, '0')";
if ( !($db->sql_query($sql)) )
{
message_die(GENERAL_ERROR, 'Error insert default groupst', '', __LINE__, __FILE__, $sql);
}
}

$sql = "INSERT INTO " . USER_GROUP_TABLE . " (user_id, group_id, user_pending)
VALUES ($user_id, $group_id, 0)";
if( !($result = $db->sql_query($sql, END_TRANSACTION)) )
{
message_die(GENERAL_ERROR, 'Could not insert data into user_group table', '', __LINE__, __FILE__, $sql);
}
$HTTP_POST_VARS[POST_USERS_URL] = $user_id;
} else
{
//make script use default user as a starting point
$HTTP_POST_VARS[POST_USERS_URL] = DEFAULT_USER_ID;
}
}
// End add - Admin add user MOD

#
#-----[ FIND ]------------------------------------------------
#
if ( ( $mode == 'save' && isset( $HTTP_POST_VARS['submit'] ) ) || isset( $HTTP_POST_VARS['avatargallery'] ) || isset( $HTTP_POST_VARS['submitavatar'] ) || isset( $HTTP_POST_VARS['cancelavatar'] ) )
{
$user_id = intval($HTTP_POST_VARS['id']);
#
#-----[ REPLACE WITH ]----------------------------------------
#
// Start replacement - Admin add user MOD
if ( ( $mode == 'save' && isset( $HTTP_POST_VARS['submit'] ) ) || isset( $HTTP_POST_VARS['avatargallery'] ) || isset( $HTTP_POST_VARS['submitavatar'] ) || isset( $HTTP_POST_VARS['cancelavatar'] ) )
{
$user_id = ($new_user) ? $user_id : intval($HTTP_POST_VARS['id']);
// End replacement - Admin add user MOD
#
#-----[ FIND ]------------------------------------------------
#
if( $HTTP_POST_VARS['deleteuser'] && ( $userdata['user_id'] != $user_id ) )
#
#-----[ REPLACE WITH ]----------------------------------------
#
if( $HTTP_POST_VARS['deleteuser'] && ( $userdata['user_id'] != $user_id ) && $new_user==0 )
#
#-----[ FIND ]------------------------------------------------
#
if ($signature != '')

#
#-----[ BEFORE, ADD ]-----------------------------------------
#

// Start add - Admin add user MOD
else if ($new_user)
{
//no password given for this new user, create default password
$password = md5(DEFAULT_PASSWD);
$passwd_sql = "user_password = '$password', ";
//send out email notification goes here
}
// End add - Admin add user MOD

#
#-----[ FIND ]------------------------------------------------
#
//
// Now parse and display it as a template

#
#-----[ BEFORE, ADD ]-----------------------------------------
#

// Start add - Admin add user MOD
if ($new_user)
{
$this_userdata['username'] = $HTTP_POST_VARS['username'];
$this_userdata['user_email'] = '';
$this_userdata['user_passwd_change'] = 0;
} else
{
$template->assign_block_vars('switch_show_delete', array());
}
// End add - Admin add user MOD

#
#-----[ FIND ]------------------------------------------------
#
$s_hidden_fields .= '<input type="hidden" name="id"

#
#-----[ BEFORE, ADD ]-----------------------------------------
#

// Start add - Admin add user MOD
$s_hidden_fields .= '<input type="hidden" name="new_user" value="'.$new_user.'" />';
// End add - Admin add user MOD

#
#-----[ FIND ]------------------------------------------------
#
"L_USER_EXPLAIN" => $lang['User_admin_explain'],
#
#-----[ REPLACE WITH ]--------------------------------
#
"L_USER_EXPLAIN" => ($new_user) ? sprintf( $lang['Create_user_explain'],'<a href="'.append_sid('/profile.'.$phpEx.'?mode=viewprofile&'.POST_USERS_URL.'='.$default_user['user_id']).'">'.$default_user['username'].'</a>', DEFAULT_PASSWD ) : $lang['User_admin_explain'],
#
#-----[ FIND ]------------------------------------------------
#
$s_hidden_fields .= '<input type="hidden" name="id"

#
#-----[ BEFORE, ADD ]-----------------------------------------
#

// Start add - Admin add user MOD
$s_hidden_fields .= '<input type="hidden" name="new_user" value="'.$new_user.'" />';
// End add - Admin add user MOD

#
#-----[ FIND ]------------------------------------------------
#
'L_USER_EXPLAIN' => $lang['User_admin_explain'],
#
#-----[ REPLACE WITH ]--------------------------------
#
'L_USER_EXPLAIN' => ($new_user) ? sprintf( $lang['Create_user_explain'],'<a href="'.append_sid('/profile.'.$phpEx.'?mode=viewprofile&'.POST_USERS_URL.'='.$default_user['user_id']).'">'.$default_user['username'].'</a>', DEFAULT_PASSWD ) : $lang['User_admin_explain'],
#
#-----[ FIND ]------------------------------------------------
#
'body' => 'admin/user_select_body.tpl')
);

#
#-----[ AFTER, ADD ]------------------------------------------
#

// Start add - Admin add user MOD
$template->assign_block_vars('switch_add_user_on', array());
// End add - Admin add user MOD

#
#-----[ FIND ]------------------------------------------------
#
'L_FIND_USERNAME' => $lang['Find_username'],

#
#-----[ AFTER, ADD ]------------------------------------------
#

// Start add - Admin add user MOD
'L_CREATE_USER' => $lang['Create_user'],
// End add - Admin add user MOD

#
#-----[ OPEN ]------------------------------------------------
#
language/lang_english/lang_admin.php

#
#-----[ FIND ]------------------------------------------------
#
?>

#
#-----[ BEFORE, ADD ]-----------------------------------------
#

// Start add - Admin add user MOD
$lang['Create_user'] = 'Create new user';
$lang['Create_user_explain'] = 'You are about to create a new user, when creating a new user, the script will look up the data from this user %s, the user ID of this user is hard coded into the file admin_users.php, you may change this setting in the top of this file if another user ID should be used.<br />There is 2 exeptions from this: <br />1. users Password will default to "%s" if you do not specify differently into the admin add user page<br />2. users email must be filled into the admin add user page';
// End add - Admin add user MOD

#
#-----[ OPEN ]------------------------------------------------
#
templates/subSilver/admin/user_edit_body.tpl

#
#-----[ FIND ]------------------------------------------------
#
<tr>
{L_DELETE_USER}

#
#-----[ BEFORE, ADD ]-----------------------------------------
#

<!-- Start add - Admin add user MOD -->
<!-- BEGIN switch_show_delete -->
<!-- End add - Admin add user MOD -->

#
#-----[ FIND ]------------------------------------------------
#
{L_DELETE_USER_EXPLAIN}
</tr>

#
#-----[ AFTER, ADD ]------------------------------------------
#

<!-- Start add - Admin add user MOD -->
<!-- END switch_show_delete -->
<!-- End add - Admin add user MOD -->

#
#-----[ OPEN ]------------------------------------------------
#
templates/subSilver/admin/user_select_body.tpl

#
#-----[ FIND ]------------------------------------------------
#
<td class="row1" align="center"><input type="text" class="post" name="username" maxlength="50" size="20" /> <input type="hidden" name="mode" value="edit" />{S_HIDDEN_FIELDS}<input type="submit" name="submituser" value="{L_LOOK_UP}" class="mainoption" /> <input type="submit" name="usersubmit" value="{L_FIND_USERNAME}" class="liteoption" onClick="window.open('{U_SEARCH_USER}', '_phpbbsearch', 'HEIGHT=250,resizable=yes,WIDTH=400');return false;" />
#
#-----[ REPLACE WITH ]----------------------------------
#
<td class="row1" align="center">
<input type="text" class="post" name="username" maxlength="50" size="20" />
<input type="hidden" name="mode" value="edit" />{S_HIDDEN_FIELDS}<input type="submit" name="submituser" value="{L_LOOK_UP}" class="mainoption" />
<input type="submit" name="usersubmit" value="{L_FIND_USERNAME}" class="liteoption" onClick="window.open('{U_SEARCH_USER}', '_phpbbsearch', 'HEIGHT=250,resizable=yes,WIDTH=400');return false;" />
<input type="checkbox" name="new_user">{L_CREATE_USER}
#
#-----[ SAVE/CLOSE ALL FILES ]--------------------------------
#
# EoM
[/code]
leecovuk
Poster
Poster
 
Posts: 3
Joined: Wed 25. May, 2005 04:15

Postby justaaron on Fri 02. Dec, 2005 23:05

I don't understand enough about Easymod and valid mod actions to be able to understand why the error featured in this topic appears;
however, I think I have re-written this mod so that it reads more simply;
It appears to work via Easymod on phpBB 2.0.18 but I would be grateful if someone could confirm my version below is exactly right for a 'clean' un-mod'ed phpbb 2.0.18.


Just a note to say thanks leecovuk, I used your version in EM and it worked great. I'm using 2.0.18.

I didn't try the vanilla version since I poked around and saw posts here and there indicating people had trouble with this and EM, decided to try yours first and it worked fine.
justaaron
Poster
Poster
 
Posts: 1
Joined: Fri 02. Dec, 2005 22:35

PreviousNext

Return to Admin add users [2.0.8/EM]

Who is online

Users browsing this forum: No registered users and 1 guest

cron