Changeset 1951036
- Timestamp:
- 10/03/2018 06:41:18 PM (7 years ago)
- Location:
- cyclos/trunk
- Files:
-
- 2 edited
-
cyclos-public.php (modified) (7 diffs)
-
readme.txt (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
cyclos/trunk/cyclos-public.php
r1809299 r1951036 69 69 70 70 if ($showForgotPassword) { 71 $returnToValue = ""; 72 if(isset($_GET["returnTo"])){ 73 $returnToValue = $_GET["returnTo"]; 74 } 71 75 $out = $out . ' 72 76 <div class="cyclosFormBox cyclosForgotContainer" style="display:none"> … … 99 103 <form class="cyclosLoginForm" action="#" method="post"> 100 104 <div class="cyclosFormTitle">' . $t->loginTitle . '</div> 105 <div> 106 <input name="cyclosReturn" value="'. $returnToValue .'" type="hidden"> 107 </div> 101 108 <div class="cyclosFormField"> 102 109 <input placeholder="' . $t->loginName . '" name="cyclosPrincipal" type="text" required> … … 131 138 var principal = this.cyclosPrincipal.value.trim(); 132 139 var password = this.cyclosPassword.value.trim(); 140 var returnTo = this.cyclosReturn.value.trim(); 133 141 134 142 if (principal != "" && password != "") { 135 143 var data = { 136 144 "principal": principal, 137 "password": password 145 "password": password, 146 "returnTo": returnTo 138 147 } 139 148 … … 144 153 response = response || {}; 145 154 if (response.redirectUrl) { 146 location.href = response.redirectUrl; 155 var redirect = response.redirectUrl; 156 if(response.returnTo && response.returnTo !== ""){ 157 redirect += "&returnTo=" + encodeURIComponent(response.returnTo); 158 } 159 location.href = redirect; 147 160 } else { 148 161 alert(response.errorMessage || "Invalid data received from server"); … … 279 292 $params->user = array("principal" => sanitize_text_field($_POST["principal"])); 280 293 $params->password = sanitize_text_field($_POST["password"]); 294 $returnTo = $_POST["returnTo"]; 281 295 $params->remoteAddress = $_SERVER['REMOTE_ADDR']; 282 296 $result = $loginService->loginUser($params); … … 300 314 } 301 315 } 302 303 316 // Get the redirect url if there were no errors 304 317 if (!empty($result)) { … … 309 322 $response = array( 310 323 "redirectUrl" => $redirectUrl, 324 "returnTo" => $returnTo, 311 325 "errorMessage" => $errorMessage 312 326 ); -
cyclos/trunk/readme.txt
r1809314 r1951036 5 5 Requires at least: 4.3 6 6 Tested up to: 4.9.2 7 Stable tag: 1.1. 57 Stable tag: 1.1.6 8 8 License: GPLv2 9 9 … … 34 34 35 35 == Changelog == 36 = 1.1.6 - 2018-10-03 = 37 We added support to go to a specific page in Cyclos instead of the home after a successfully login. 38 36 39 = 1.1.5 - 2018-01-25 = 37 40 We updated the plugin to be compatible with PHP 7.2.
Note: See TracChangeset
for help on using the changeset viewer.