Hi,
This is a method in a class called userlib, The functionality of this method is to add users info into users_users. can any body explain the class?. Not entire class but at query
This will be called by this command
$userlib->add_user($REQUEST["name"],$REQUEST["pass"],$REQUEST["email"],'',$REQUEST['useradd'],$_REQUEST['phoneno']);
This is query
$query = "insert into
users_users(login, password, email, provpass,
registrationDate, hash, pass_due, created,address,phoneno)
values(?,?,?,?,?,?,?,?,?,?)";
how this ?????? marks really works
what is the secret behid this
$result = $this->query($query, array(
$user,
$pass,
$email,
$provpass,
(int) $now,
$hash,
(int) $new_pass_due,
(int) $now,
$useradd,
$phoneno
));
Entire method in a class
function add_user($user, $pass, $email, $provpass = '', $useradd, $phoneno) {
global $pass_due, $tikilib;
global $feature_clear_passwords;
// Generate a unique hash; this is also done below in set_user_fields()
$hash = md5($user . $pass . $email);
if ($feature_clear_passwords == 'n')
$pass = '';
if ($this->user_exists($user))
return false;
$now = date("U");
$new_pass_due = $now + (60 * 60 * 24 * $pass_due);
$query = "insert into
`users_users`(`login`, `password`, `email`, `provpass`,
`registrationDate`, `hash`, `pass_due`, `created`,`address`,`phoneno`)
values(?,?,?,?,?,?,?,?,?,?)";
$result = $this->query($query, array(
$user,
$pass,
$email,
$provpass,
(int) $now,
$hash,
(int) $new_pass_due,
(int) $now,
$useradd,
$phoneno
));
$this->assign_user_to_group($user, 'Registered');
if( $tikilib->get_preference("eponymousGroups", 'n') == 'y' )
{
// Create a group just for this user, for permissions
// assignment.
$this->add_group($user, "Personal group for $user.", '');
$this->assign_user_to_group($user, $user);
}
return true;
echo "subbu ok";
}
bye
sharma