예제 #1
0
         }
     }
 }
 if ($error != "ko") {
     $encode = "1";
     if ($password_new == "") {
         $encode = "0";
         $db = file("db/users");
         foreach ($db as $line) {
             $data = explode("**", $line);
             if ($data[0] == $user_confirmed) {
                 $password_new = $data[1];
             }
         }
     }
     $deleting = kh_user_del($user_confirmed, $old_pin);
     if ($deleting == 'ok') {
         $adding = kh_user_add($user_new, $password_new, $name_new, $congregation_new, $rights_new, $pin, $type_new, $last_login, $info_new, $encode);
         if ($adding == 'ok') {
             echo '<div id="ok_msg">' . $lng['op_ok'] . '...</div>';
             $info = time() . '**info**local user edit successful**' . $user_confirmed . '@' . $old_cong . '->' . $user_new . '@' . $congregation_new . "**\n";
             $file = fopen('./db/logs-' . date("Y", time()) . '-' . date("m", time()), 'a');
             if (fputs($file, $info)) {
                 fclose($file);
             }
         } else {
             echo $adding;
             $info = time() . '**error**local user edit fail add**' . $user_confirmed . '@' . $old_cong . '->' . $user_new . '@' . $congregation_new . "**\n";
             $file = fopen('./db/logs-' . date("Y", time()) . '-' . date("m", time()), 'a');
             if (fputs($file, $info)) {
                 fclose($file);
예제 #2
0
파일: api.php 프로젝트: kh-live/khlive
 $param = explode('###', $query[2]);
 $pin = $param[2];
 $cong = $param[1];
 $user_del = $param[0];
 if ($server_beta == "master") {
     $db = file("./db/servers");
     foreach ($db as $line) {
         $data = explode("**", $line);
         if (strstr($data[3], $cong)) {
             $api_key = $data[2];
         }
     }
 }
 //we tell the function not to loop back
 $api = "1";
 $deleting = kh_user_del($user_del, $pin, $api);
 if ($deleting != 'ok') {
     $error = "1";
 }
 if ($error == "0") {
     $string = time() . "@@@ok";
     //we log that the ip has been updated
     $info = time() . '**info**user delete successful**' . $user_del . '@' . $cong . "**\n";
     $file = fopen('./db/logs-' . date("Y", time()) . '-' . date("m", time()), 'a');
     if (fputs($file, $info)) {
         fclose($file);
     }
 } else {
     $string = time() . "@@@ko";
     $info = time() . '**info**user del fail**' . $user_del . '@' . $cong . "**\n";
     $file = fopen('./db/logs-' . date("Y", time()) . '-' . date("m", time()), 'a');