Skip to content

Commit

Permalink
Fixed issue: Database error when username or user full name too long
Browse files Browse the repository at this point in the history
  • Loading branch information
c-schmitz committed Jan 5, 2021
1 parent c8ebbca commit dcbcae3
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
2 changes: 2 additions & 0 deletions application/models/User.php
Expand Up @@ -81,6 +81,8 @@ public function rules()
return array(
array('users_name, password, email', 'required'),
array('users_name', 'unique'),
array('users_name', 'length','max'=>64),
array('full_name', 'length','max'=>50),
array('email', 'email'),
array('full_name', 'LSYii_Validators'), // XSS if non super-admin
array('parent_id', 'default', 'value'=>0),
Expand Down
4 changes: 2 additions & 2 deletions application/views/admin/user/editusers.php
Expand Up @@ -107,7 +107,7 @@
<div class="form-group">
<label for="new_user" class="control-label"><?php eT("Username:");?></label>
<div class="">
<input type='text' class="text input-sm form-control" id='new_user' name='new_user' required />
<input type='text' class="text input-sm form-control" maxlength='64' id='new_user' name='new_user' required />
</div>
</div>
<div class="form-group">
Expand All @@ -119,7 +119,7 @@
<div class="form-group">
<label for="new_full_name" class="control-label "><?php eT("Full name:");?></label>
<div class="">
<input type='text' class="text input-sm form-control" id='new_full_name' name='new_full_name' required />
<input type='text' class="text input-sm form-control" maxlength='50' id='new_full_name' name='new_full_name' required />
</div>
</div>
<div class="form-group">
Expand Down
4 changes: 2 additions & 2 deletions application/views/admin/user/modifyuser.php
Expand Up @@ -43,8 +43,8 @@
<?php eT("Full name");?>
</label>
<div class="">
<?php echo $form->textField($oUser, 'full_name');?>
</div>
<?php echo $form->textField($oUser, 'full_name', array('maxlength'=>50));?>
</div>
</div>

<?php if( !Permission::model()->hasGlobalPermission('superadmin','read', $oUser->uid) || (Permission::isForcedSuperAdmin(Permission::getUserId())) ): ?>
Expand Down

0 comments on commit dcbcae3

Please sign in to comment.