diff --git a/assets/modul-js/common/profile/editprofile.js b/assets/modul-js/common/profile/editprofile.js index a62bb9b..cb4024f 100755 --- a/assets/modul-js/common/profile/editprofile.js +++ b/assets/modul-js/common/profile/editprofile.js @@ -37,7 +37,14 @@ var Script = function () { $("#waiting").hide(); $("#suksesupdate").show(); //$("#gagalupdate").hide(); - }else{ + } + else if(e.status === 304){ + $("#submitprofile").show(); + $("#waiting").hide(); + $("#update-unchanged").show(); + //$("#gagalupdate").hide(); + } + else{ $("#submitprofile").show(); $("#waiting").hide(); //$("#suksesupdate").show(); diff --git a/includes/func.class/logs/2018-03-26.txt b/includes/func.class/logs/2018-03-26.txt new file mode 100644 index 0000000..5b7adf3 --- /dev/null +++ b/includes/func.class/logs/2018-03-26.txt @@ -0,0 +1,43 @@ +Time : 18:02:06 +SQLSTATE[28000] [1045] Access denied for user 'izyim'@'localhost' (using password: YES) + +Time : 18:02:05 +SQLSTATE[28000] [1045] Access denied for user 'izyim'@'localhost' (using password: YES) + +Time : 17:57:23 +SQLSTATE[28000] [1045] Access denied for user 'izyim'@'localhost' (using password: YES) + +Time : 17:57:17 +SQLSTATE[28000] [1045] Access denied for user 'izyim'@'localhost' (using password: YES) + +Time : 17:56:52 +SQLSTATE[28000] [1045] Access denied for user 'izyim'@'localhost' (using password: YES) + +Time : 17:53:06 +SQLSTATE[28000] [1045] Access denied for user 'izyim'@'localhost' (using password: YES) + +Time : 17:52:08 +SQLSTATE[42S02]: Base table or view not found: 1146 Table 'izyim.users' doesn't exist +Raw SQL : SELECT * FROM users WHERE username= :username + +Time : 17:51:30 +SQLSTATE[42S02]: Base table or view not found: 1146 Table 'izyim.users' doesn't exist +Raw SQL : SELECT * FROM users WHERE username= :username + +Time : 17:51:20 +SQLSTATE[28000] [1045] Access denied for user 'izyim'@'localhost' (using password: YES) + +Time : 17:51:00 +SQLSTATE[28000] [1045] Access denied for user 'izyim'@'localhost' (using password: YES) + +Time : 17:50:53 +SQLSTATE[28000] [1045] Access denied for user 'izyim'@'localhost' (using password: YES) + +Time : 17:49:08 +SQLSTATE[28000] [1045] Access denied for user 'izyim'@'localhost' (using password: YES) + +Time : 17:49:08 +SQLSTATE[28000] [1045] Access denied for user 'izyim'@'localhost' (using password: YES) + +Time : 17:48:56 +SQLSTATE[28000] [1045] Access denied for user 'izyim'@'localhost' (using password: YES) diff --git a/modul/common/profile/editprofile.tpl.php b/modul/common/profile/editprofile.tpl.php index 8557d13..0db2498 100755 --- a/modul/common/profile/editprofile.tpl.php +++ b/modul/common/profile/editprofile.tpl.php @@ -78,6 +78,9 @@ + diff --git a/modul/common/profile/init.php b/modul/common/profile/init.php index 8eca9e6..d5be86f 100755 --- a/modul/common/profile/init.php +++ b/modul/common/profile/init.php @@ -30,7 +30,7 @@ function chpwd_js() { function editprofile_js() { ?> - + get('email'); $website = $request->get('website'); $position = $request->get('position'); + $user_id = $_SESSION["user_id"]; // Bind the data $db->bind("first_name", $first_name); $db->bind("last_name", $last_name); @@ -71,13 +72,18 @@ function the_profile() { $db->bind("email", $email); $db->bind("website", $website); $db->bind("user_id", $_SESSION["user_id"]); + $profileupdate = $db->query("UPDATE user_detail SET first_name = :first_name, last_name = :last_name, email= :email, website= :website , position= :position WHERE user_id = :user_id"); - if ($profileupdate) { + if ($profileupdate > 0) { action_log($_SESSION['user_id'], "Profile Update", "SUCCESS"); return new Response('Success', 200); - } else { + } + else if ($profileupdate == 0){ + return new Response('Not affected', 304); + } + else { action_log($_SESSION['user_id'], "Profile Update", "FAILED"); - return new Response('Failed', 201); + return new Response('Failed', 400); } }); $app->post('/profile/edit/updatepic', function (Request $request) {