예제 #1
0
     helper_result('my_update_user', 'error', txt('pass_not_match'));
 } else {
     //pass
     if (!empty($tmp_pass1) && (strlen($tmp_pass1) < 6 || strlen($tmp_pass1) > 30)) {
         helper_result('my_update_user_result', 'result', 'error');
         helper_result('my_update_user', 'error', txt('pass_length'));
     } else {
         $new_usr = new phpos_users();
         $new_usr->set_id_user($user_id);
         $new_usr->get_user_by_id();
         $error = 0;
         if (!empty($tmp_pass1)) {
             // check old pass
             if (!empty($tmp_old_pass)) {
                 // check pass
                 $pass_now_hash = $new_usr->get_user_pass();
                 //check new
                 $new_usr->set_raw_pass($tmp_old_pass);
                 $old_pass_hash = $new_usr->generate_password();
                 if ($pass_now_hash == $old_pass_hash) {
                     $new_usr->set_raw_pass($tmp_pass1);
                     $new_pass = $new_usr->generate_password();
                     $new_usr->set_user_pass($new_pass);
                 } else {
                     $error = 1;
                     helper_result('my_update_user_result', 'result', 'error');
                     helper_result('my_update_user', 'error', txt('pass_old_wrong'));
                 }
             } else {
                 $error = 1;
                 helper_result('my_update_user_result', 'result', 'error');
예제 #2
0
		<td><b>X</b></td>
		</tr>';
    for ($i = 0; $i < $c; $i++) {
        $u = new phpos_users();
        $u->set_id_user($users_ids[$i]);
        $u->get_user_by_id();
        $id = $u->get_id_user();
        $class = 'phpos_table_row1';
        if ($i % 2 == 0) {
            $class = 'phpos_table_row2';
        }
        echo '<tr class="' . $class . '">
		<td>' . $users_ids[$i] . '</td>
		<td>' . $u->get_id_user() . '</td>
		<td>' . $u->get_user_login() . '</td>
		<td>' . $u->get_user_pass() . '</td>
		<td>' . $u->get_user_email() . '</td>
		<td>' . $u->get_user_type() . '</td>
		<td>' . $u->get_id_group() . '</td>
		<td>' . $u->get_is_active() . '</td>
		<td>' . $u->get_created_at() . '</td>
		<td>' . $u->get_last_login() . '</td>
		<td>' . $u->get_last_activity() . '</td>
		<td>' . $u->get_note() . '</td>
		<td><a href="javascript:void(0);" onclick="' . helper_reload(array('delete_id' => $id)) . '"><span style="color:red">(x)</span></a></td>
		</tr>';
        unset($u);
    }
    echo '</table>';
}
?>