Commit 365177f8b75f7149be86298a9336d609fbba8358
1 parent
b15debd3
angular sinitize => cdn + user duplicate username
Showing
2 changed files
with
5 additions
and
4 deletions
Show diff stats
app/library/App/Controllers/UserController.php
| @@ -110,16 +110,15 @@ class UserController extends CrudResourceController | @@ -110,16 +110,15 @@ class UserController extends CrudResourceController | ||
| 110 | 110 | ||
| 111 | protected function postDataValid($data, $isUpdate) | 111 | protected function postDataValid($data, $isUpdate) |
| 112 | { | 112 | { |
| 113 | + //проверка на регистрацию существующего username | ||
| 113 | $input_name = $data['username']; | 114 | $input_name = $data['username']; |
| 114 | - if (!empty($input_name)) | 115 | + if (!$isUpdate) |
| 115 | { | 116 | { |
| 116 | - | ||
| 117 | $same_user = User::find(["username = '".$input_name."'"]); | 117 | $same_user = User::find(["username = '".$input_name."'"]); |
| 118 | if (isset($same_user[0]) && !empty($same_user[0]->username)) | 118 | if (isset($same_user[0]) && !empty($same_user[0]->username)) |
| 119 | { | 119 | { |
| 120 | return false; | 120 | return false; |
| 121 | } | 121 | } |
| 122 | - | ||
| 123 | } | 122 | } |
| 124 | 123 | ||
| 125 | return true; | 124 | return true; |
app/views/general/documentation.phtml
| @@ -118,7 +118,9 @@ | @@ -118,7 +118,9 @@ | ||
| 118 | <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script> | 118 | <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script> |
| 119 | <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js"></script> | 119 | <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js"></script> |
| 120 | <script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.4.8/angular.min.js"></script> | 120 | <script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.4.8/angular.min.js"></script> |
| 121 | -<script src="https://code.angularjs.org/1.4.8/angular-sanitize.min.js"></script> | 121 | +<script src="https://cdnjs.cloudflare.com/ajax/libs/angular-sanitize/1.4.8/angular-sanitize.min.js"></script> |
| 122 | +<!--<script src="https://code.angularjs.org/1.4.8/angular-sanitize.min.js"></script>--> | ||
| 123 | + | ||
| 122 | <script> | 124 | <script> |
| 123 | var documentationPath = '<?php echo $documentationPath ?>'; | 125 | var documentationPath = '<?php echo $documentationPath ?>'; |
| 124 | var app = angular.module('app', [ | 126 | var app = angular.module('app', [ |