| Conditions | 4 |
| Paths | 7 |
| Total Lines | 20 |
| Code Lines | 12 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 21 | public function postLoginDeveloper() { |
||
| 22 | try{ |
||
| 23 | cb()->validation([ |
||
| 24 | 'username'=>'required', |
||
| 25 | 'password'=>'required' |
||
| 26 | ]); |
||
| 27 | |||
| 28 | if(request('username') == getSetting('developer_username') |
||
| 29 | && request('password') == getSetting("developer_password")) { |
||
| 30 | |||
| 31 | session(['developer'=>getSetting('developer_username')]); |
||
| 32 | |||
| 33 | return redirect(cb()->getDeveloperUrl()); |
||
| 34 | |||
| 35 | }else{ |
||
| 36 | return cb()->redirectBack( cbLang("password_and_username_is_wrong")); |
||
| 37 | } |
||
| 38 | |||
| 39 | }catch (CBValidationException $e) { |
||
| 40 | return cb()->redirect(cb()->getLoginUrl(),$e->getMessage(),'warning'); |
||
| 41 | } |
||
| 50 | } |