Check Existing Users

Discussion in 'Installation/Configuration' started by dayjahone, Jul 13, 2007.

  1. dayjahone

    dayjahone Member

    Is there a function with remoting access that checks to see if a user already exists?

  2. till

    till Super Moderator Staff Member ISPConfig Developer

    From the examples:

    // Get a User
    $params = array ( 'sid' => $session_id,
    'module' => 'web',
    'function' => 'user_get',
    'params' => array ( user_username => 'web21_heinz' // user_username or user_id

    $user = $soapclient->call('service',$params);
    if($err = $soapclient->getError()) die("Error: ".$err);
  3. dayjahone

    dayjahone Member

    Thanks, Till. I'm fumbling my way trying to create a form that adds a user and sends me an email. It works. The only problem is I can't get it to check if the user already exists. I can't just use the variable $user?
    Last edited: Jul 15, 2007
  4. till

    till Super Moderator Staff Member ISPConfig Developer

    Please use the function that I posted above.

    If the function returns the data of a user in the $user array, the user exists.
  5. dayjahone

    dayjahone Member

    Is there a way to call just the username?
    I'm trying to set up a check similar to the following:
    if(trim($user)==$new_username) { 
    			$error.="That username is already taken.<br />";
    $user doesn't work because $user contains all of the information on the user.
  6. falko

    falko Super Moderator ISPConfig Developer

    You can try this:

    trim($user)==$new_username) { 
    $error.="That username is already taken.<br />";
    You will then see which array element holds the username (e.g. $user["user_name"]).
  7. dayjahone

    dayjahone Member

    Falko! It finally works! All I needed was the syntax to check a specific parameter in a variable. Thank you! Thank you! Thank you! Your posts are always super helpful.

Share This Page