Skip to content
This repository has been archived by the owner on Dec 8, 2020. It is now read-only.

made changes to user while creating hosts #278

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions app/controller/usercontroller.ctrl.php
Original file line number Diff line number Diff line change
Expand Up @@ -377,9 +377,12 @@ public function create() {
$error['role'] = 'Please select a role for the User.';
}

if(empty($group)){
$group = NULL;
if((empty($groups)) && ($role == '3'))
{
$groups = NULL;
$error['group'] = 'Please select a group for the User.';
}

if(!$this->User->checkEmail($email)){
$error['email'] = 'This email is already in use in our database. Please use another one.';
}
Expand Down
2 changes: 1 addition & 1 deletion app/view/host/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
<li class="group-list clearfix">
<div class="pull-left">
<?php if(!empty($g->path)) { ?>
<img src="/uploads/thumbnail_<?php echo $g->path; ?>" width="40" height="40" alt="<?php echo $g->name; ?> Image" class="profile-pic" />
<img src="/uploads/thumbnail_<?php echo $g->path; ?>" width="60" height="60" alt="<?php echo $g->name; ?> Image" class="profile-pic" />
<?php } else { ?>
<img src="/uploads/mid_1474993329ef38d3a4b9478841cc2346f8e131842fdcfd073b307.jpg" width="40" height="40" alt="<?php echo $group->name; ?> Image" class="profile-pic clearfix"/>
<?php } ?>
Expand Down
9 changes: 4 additions & 5 deletions app/view/user/create.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@

</div>
<div class="col-md-6">
<?php /*
<?php /*

<div class="form-group <?php if(isset($error) && isset($error['name']) && !empty($error['name'])) { echo "has-error"; } ?>">
<label for="password">Password:</label>
Expand All @@ -56,18 +56,17 @@
</div>

*/ ?>

<div class="form-group <?php if(isset($error) && isset($error['group']) && !empty($error['group'])) { echo "has-error"; } ?>">
<label for="group">Group(s):</label>
<?php if(isset($error) && isset($error['group']) && !empty($error['group'])) { echo '<span class="help-block text-danger">' . $error['group'] . '</span>'; } ?>
<?php foreach($groups as $group){ ?>
<div class="checkbox">
<label>
<input value="<?php echo $group->id; ?>" type="checkbox" name="groups[]" id="group-<?php echo $group->id; ?>"> <?php echo $group->name; ?>
</label>
<?php } ?>
</div>

<?php } ?>
<?php if(isset($error) && isset($error['group']) && !empty($error['group'])) { echo '<span class="help-block text-danger">' . $error['group'] . '</span>'; } ?>

</div>

<div class="form-group">
Expand Down