I have a class admin user which has some rights to modify user data. I want to add two or more attributes to this method to complete the required functionality.
function update_user_by_admin($new_level, $user_id, $def_pass, $new_email, $active, $confirmation = "no", $staff_salary, $set_duty_timings) {
$this->user_found = true;
$this->user_access_level = $new_level;
$this->set_staff_salary=$staff_salary;
if ($def_pass != "" && strlen($def_pass) < 4) {
$this->the_msg = "Password is too short use the min. of 4 chars.";
} else {
if ($this->check_email($new_email)) {
$sql = "UPDATE %s SET access_level = %d, email = '%s', active = '%s', salary='salary'";
$sql .= ($def_pass != "") ? sprintf(", pw = '%s'", md5($def_pass)) : "";
$sql .= " WHERE id = %d";
$sql_compl = sprintf($sql, $this->table_name, $new_level, $new_email, $active, $user_id);
if (mysql_query($sql_compl)) {
$this->the_msg = "Data is modified for user with id#<b>".$user_id."</b>";
if ($confirmation == "yes") {
if ($this->send_confirmation($user_id)) {
$this->the_msg .= "<br>...a confirmation mail has been sent to the user.";
} else {
$this->the_msg .= "<br>...ERROR no confirmation mail is sent to the user.";
}
}
} else {
$this->the_msg = "Database error, please try again!";
}
} else {
$this->the_msg = "The e-mail address is invalid!";
}
}
}
how do I add new parameter code here?