The following warnings occurred:
Warning [2] Undefined variable $unreadreports - Line: 26 - File: global.php(961) : eval()'d code PHP 8.2.25 (Linux)
File Line Function
/global.php(961) : eval()'d code 26 errorHandler->error
/global.php 961 eval
/showthread.php 28 require_once





× This forum is read only. As of July 23, 2019, the UserSpice forums have been closed. To receive support, please join our Discord by clicking here. Thank you!

  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Delete Users SQL Logic
#7
awesome, i think I've got it working, may not be the best way but seems to work, in admin_users.php find
`if($validation->passed()) {
$form_valid = TRUE;
try {

$fields=array(
'username' => Input::get('username'),
'fname' => Input::get('fname'),
'lname' => Input::get('lname'),
'email' => Input::get('email'),
'password' => password_hash(Input::get('password'), PASSWORD_BCRYPT, array('cost' => 12)),
'permissions' => 1,
'account_owner' => 1,
'stripe_cust_id' => '',
'join_date' => $join_date,
'company' => Input::get('company'),
'email_verified' => 1,
'active' => 1,
'vericode' => 111111,
);
$db->insert('users',$fields);
$theNewId=$db->lastId();
$addNewPermission = array('user_id' => $theNewId, 'permission_id' => $perm);
$db->insert('user_permission_matches',$addNewPermission);

} catch (Exception $e) {
die($e->getMessage());
}

}else{
$val_err = display_errors($validation->errors());
}`

notice above yours won't have the else statement, so add that into your file, now further down the page find the add new users form add replace:

if (!$form_valid && Input::exists()){
echo display_errors($validation->errors());
}`

with:

Code:
echo $val_err;

this should fix it, see below:

[Image: Screen%7B3bc1fe685386cc4c3ab89a3f76566d893....33.02.png]
  Reply


Messages In This Thread
Delete Users SQL Logic - by rukichirimoshi - 06-30-2016, 02:02 PM
Delete Users SQL Logic - by mudmin - 07-01-2016, 11:05 AM
Delete Users SQL Logic - by rukichirimoshi - 07-01-2016, 01:18 PM
Delete Users SQL Logic - by brian - 07-09-2016, 07:59 PM
Delete Users SQL Logic - by firestorm - 08-23-2016, 06:12 PM
Delete Users SQL Logic - by mudmin - 08-24-2016, 01:13 AM
Delete Users SQL Logic - by firestorm - 08-24-2016, 02:44 PM

Forum Jump:


Users browsing this thread: 2 Guest(s)