Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixes in tokens controller and common controller.
Added a success/failure style option to _showMessageBox() Ported User Controller git-svn-id: file:///Users/Shitiz/Downloads/lssvn/source/limesurvey_ci@10513 b72ed6b6-b9f8-46b5-92b4-906544132732
- Loading branch information
Showing
12 changed files
with
1,261 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,132 @@ | ||
<div class='header ui-widget-header'><?php echo $clang->gT("User control");?></div><br /> | ||
<table id='users' class='users' width='100%' border='0'> | ||
<thead> | ||
<tr> | ||
<th><?php echo $clang->gT("Action");?></th> | ||
|
||
<th width='20%'><?php echo $clang->gT("Username");?></th> | ||
<th width='20%'><?php echo $clang->gT("Email");?></th> | ||
<th width='20%'><?php echo $clang->gT("Full name");?></th> | ||
<?php if($this->session->userdata('USER_RIGHT_SUPERADMIN') == 1) { ?> | ||
<th width='5%'><?php echo $clang->gT("No of surveys");?></th> | ||
<?php } ?> | ||
<th width='15%'><?php echo $clang->gT("Created by");?></th> | ||
</tr></thead><tbody> | ||
<tr > | ||
<td align='center' style='padding:3px;'> | ||
<form method='post' action='<?php echo site_url("admin/user/modifyuser");?>'> | ||
<input type='image' src='<?php echo $imageurl;?>/token_edit.png' value='<?php echo $clang->gT("Edit user");?>' /> | ||
<input type='hidden' name='action' value='modifyuser' /> | ||
<input type='hidden' name='uid' value='<?php echo $usrhimself['uid'];?>' /> | ||
</form> | ||
|
||
<?php if ($usrhimself['parent_id'] != 0 && $this->session->userdata('USER_RIGHT_DELETE_USER') == 1 ) { ?> | ||
<form method='post' action='$scriptname?action=deluser'> | ||
<input type='submit' value='<?php echo $clang->gT("Delete");?>' onclick='return confirm("<?php echo $clang->gT("Are you sure you want to delete this entry?","js");?>")' /> | ||
<input type='hidden' name='action' value='deluser' /> | ||
<input type='hidden' name='user' value='<?php echo $usrhimself['user'];?>' /> | ||
<input type='hidden' name='uid' value='<?php echo $usrhimself['uid'];?>' /> | ||
</form> | ||
<?php } ?> | ||
|
||
</td> | ||
|
||
<td align='center'><strong><?php echo $usrhimself['user'];?></strong></td> | ||
<td align='center'><strong><?php echo $usrhimself['email'];?></strong></td> | ||
<td align='center'><strong><?php echo $usrhimself['full_name'];?></strong></td> | ||
|
||
<?php if($this->session->userdata('USER_RIGHT_SUPERADMIN') == 1) { ?> | ||
<td align='center'><strong><?php echo $noofsurveys;?></strong></td> | ||
<?php } ?> | ||
|
||
<?php if(isset($usrhimself['parent_id']) && $usrhimself['parent_id']!=0) { ?> | ||
<td align='center'><strong><?php echo $srow['users_name'];?></strong></td> | ||
<?php } else { ?> | ||
<td align='center'><strong>---</strong></td> | ||
<?php } ?> | ||
</tr> | ||
|
||
<?php for($i=1; $i<=count($usr_arr); $i++) { | ||
$usr = $usr_arr[$i]; ?> | ||
<tr> | ||
|
||
<td align='center' style='padding:3px;'> | ||
<?php if ($this->session->userdata('USER_RIGHT_SUPERADMIN') == 1 || $usr['uid'] == $_SESSION['loginID'] || ($this->session->userdata('USER_RIGHT_CREATE_USER') == 1 && $usr['parent_id'] == $this->session->userdata('loginID'))) { ?> | ||
<form method='post' action='<?php echo site_url("admin/user/modifyuser");?>'> | ||
<input type='image' src='<?php echo $imageurl;?>/token_edit.png' alt='<?php echo $clang->gT("Edit this user");?>' /> | ||
<input type='hidden' name='action' value='modifyuser' /> | ||
<input type='hidden' name='uid' value='<?php echo $usr['uid'];?>' /> | ||
</form> | ||
<?php } ?> | ||
|
||
<?php if ( (($this->session->userdata('USER_RIGHT_SUPERADMIN') == 1 && | ||
$usr['uid'] != $this->session->userdata('loginID') ) || | ||
($this->session->userdata('USER_RIGHT_CREATE_USER') == 1 && | ||
$usr['parent_id'] == $this->session->userdata('loginID'))) && $usr['uid']!=1) { ?> | ||
<form method='post' action='<?php echo site_url("admin/user/setuserrights/");?>'> | ||
<input type='image' src='<?php echo $imageurl;?>/security_16.png' alt='<?php echo $clang->gT("Set global permissions for this user");?>' /> | ||
<input type='hidden' name='action' value='setuserrights' /> | ||
<input type='hidden' name='user' value='<?php echo $usr['user'];?>' /> | ||
<input type='hidden' name='uid' value='<?php echo $usr['uid'];?>' /> | ||
</form> | ||
<?php } | ||
if ($this->session->userdata('loginID') == "1" && $usr['parent_id'] !=1 ) { ?> | ||
<form method='post' action='<?php echo $scriptname;?>'> | ||
<input type='submit' value='<?php echo $clang->gT("Take Ownership");?>' /> | ||
<input type='hidden' name='action' value='setasadminchild' /> | ||
<input type='hidden' name='user' value='<?php echo $usr['user'];?>' /> | ||
<input type='hidden' name='uid' value='<?php echo $usr['uid'];?>' /> | ||
</form> | ||
<?php } | ||
if (($this->session->userdata('USER_RIGHT_SUPERADMIN') == 1 || $this->session->userdata('USER_RIGHT_MANAGE_TEMPLATE') == 1) && $usr['uid']!=1) { ?> | ||
<form method='post' action='<?php echo site_url("admin/user/setusertemplates/");?>'> | ||
<input type='image' src='<?php echo $imageurl;?>/templatepermissions_small.png' alt='<?php echo $clang->gT("Set template permissions for this user");?>' /> | ||
<input type='hidden' name='action' value='setusertemplates' /> | ||
<input type='hidden' name='user' value='<?php echo $usr['user'];?>' /> | ||
<input type='hidden' name='uid' value='<?php echo $usr['uid'];?>' /> | ||
</form> | ||
<?php } | ||
if (($this->session->userdata('USER_RIGHT_SUPERADMIN') == 1 || ($this->session->userdata('USER_RIGHT_DELETE_USER') == 1 && $usr['parent_id'] == $this->session->userdata('loginID')))&& $usr['uid']!=1) { ?> | ||
<form method='post' action='<?php echo site_url("admin/user/deluser");?>'> | ||
<input type='image' src='<?php echo $imageurl;?>/token_delete.png' alt='<?php echo $clang->gT("Delete this user");?>' onclick='return confirm("<?php echo $clang->gT("Are you sure you want to delete this entry?","js");?>")' /> | ||
<input type='hidden' name='action' value='deluser' /> | ||
<input type='hidden' name='user' value='<?php echo $usr['user'];?>' /> | ||
<input type='hidden' name='uid' value='<?php echo $usr['uid'];?>' /> | ||
</form> | ||
<?php } ?> | ||
|
||
</td> | ||
<td align='center'><?php echo $usr['user'];?></td> | ||
<td align='center'><a href='mailto:<?php echo $usr['email'];?>'><?php echo $usr['email'];?></a></td> | ||
<td align='center'><?php echo $usr['full_name'];?></td> | ||
|
||
<td align='center'><?php echo $noofsurveyslist[$i];?></td> | ||
|
||
<?php $uquery = "SELECT users_name FROM ".$this->db->dbprefix('users')." WHERE uid=".$usr['parent_id']; | ||
$uresult = db_execute_assoc($uquery); //Checked | ||
$userlist = array(); | ||
$srow = $uresult->row_array(); | ||
$usr['parent'] = $srow['users_name']; ?> | ||
|
||
<?php if (isset($usr['parent_id'])) { ?> | ||
<td align='center'><?php echo $usr['parent'];?></td> | ||
<?php } else { ?> | ||
<td align='center'>-----</td> | ||
<?php } ?> | ||
|
||
</tr> | ||
<?php $row++; | ||
} ?> | ||
</tbody></table><br /> | ||
|
||
<?php if($this->session->userdata('USER_RIGHT_SUPERADMIN') == 1 || $this->session->userdata('USER_RIGHT_CREATE_USER')) { ?> | ||
<form action='<?php echo site_url("admin/user/adduser");?>' method='post'> | ||
<table class='users'><tr class='oddrow'> | ||
<th><?php echo $clang->gT("Add user:");?></th> | ||
<td align='center' width='20%'><input type='text' name='new_user' /></td> | ||
<td align='center' width='20%'><input type='text' name='new_email' /></td> | ||
<td align='center' width='20%' ><input type='text' name='new_full_name' /></td><td width='8%'> </td> | ||
<td align='center' width='15%'><input type='submit' value='<?php echo $clang->gT("Add User");?>' /> | ||
<input type='hidden' name='action' value='adduser' /></td> | ||
</tr></table></form><br /> | ||
<?php } ?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
<div class='header ui-widget-header'><?php echo $clang->gT("Editing user");?></div><br /> | ||
<form action='<?php echo site_url("admin/user/moduser");?>' method='post'> | ||
<table class='edituser'><thead><tr> | ||
<th><?php echo $clang->gT("Username");?></th> | ||
<th><?php echo $clang->gT("Email");?></th> | ||
<th><?php echo $clang->gT("Full name");?></th> | ||
<th><?php echo $clang->gT("Password");?></th> | ||
</tr></thead> | ||
<tbody><tr> | ||
<?php foreach ($mur->result_array() as $mrw) { | ||
$mrw = array_map('htmlspecialchars', $mrw); ?> | ||
<td align='center'><strong><?php echo $mrw['users_name'];?></strong></td> | ||
<td align='center'> <input type='text' size='30' name='email' value="<?php echo $mrw['email'];?>" /></td> | ||
<td align='center'> <input type='text' size='30' name='full_name' value="<?php echo $mrw['full_name'];?>" /> | ||
<input type='hidden' name='user' value="<?php echo $mrw['users_name'];?>" /> | ||
<input type='hidden' name='uid' value="<?php echo $mrw['uid'];?>" /></td> | ||
<td align='center'> <input type='password' name='pass' value="%%unchanged%%" /></td> | ||
<?php } ?> | ||
</tr> | ||
</tbody> | ||
</table> | ||
<p> | ||
<input type='submit' value='<?php echo $clang->gT("Save");?>' /> | ||
<input type='hidden' name='action' value='moduser' /> | ||
</p> | ||
</form> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,89 @@ | ||
<?php // prepare data for the htmleditormode preference | ||
$edmod1=''; | ||
$edmod2=''; | ||
$edmod3=''; | ||
$edmod4=''; | ||
switch ($this->session->userdata('htmleditormode')) | ||
{ | ||
case 'none': | ||
$edmod2="selected='selected'"; | ||
break; | ||
case 'inline': | ||
$edmod3="selected='selected'"; | ||
break; | ||
case 'popup': | ||
$edmod4="selected='selected'"; | ||
break; | ||
default: | ||
$edmod1="selected='selected'"; | ||
break; | ||
} ?> | ||
|
||
<div class='formheader'> | ||
<strong><?php echo $clang->gT("Your personal settings");?></strong> | ||
</div> | ||
<div> | ||
<form action='<?php echo site_url("admin/user/personalsettings/");?>' id='personalsettings' method='post'> | ||
<ul> | ||
|
||
<li><label for='lang'><?php echo $clang->gT("Interface language");?>:</label> | ||
<select id='lang' name='lang'> | ||
<option value='auto'<?php if ($sSavedLanguage == 'auto') {echo " selected='selected'";} ?>> | ||
<?php echo $clang->gT("(Autodetect)");?></option> | ||
<?php foreach (getlanguagedata(true) as $langkey=>$languagekind) { ?> | ||
<option value='<?php echo $langkey;?>'<?php if ($langkey == $sSavedLanguage) {echo " selected='selected'";}?>> | ||
<?php echo $languagekind['nativedescription'];?> - <?php echo $languagekind['description'];?></option> | ||
<?php } ?> | ||
</select> | ||
</li> | ||
|
||
<li> | ||
<label for='htmleditormode'><?php echo $clang->gT("HTML editor mode");?>:</label> | ||
<select id='htmleditormode' name='htmleditormode'> | ||
<option value='default' <?php echo $edmod1;?>><?php echo $clang->gT("Default");?></option> | ||
<option value='inline' <?php echo $edmod3;?>><?php echo $clang->gT("Inline HTML editor");?></option> | ||
<option value='popup' <?php echo $edmod4;?>><?php echo $clang->gT("Popup HTML editor");?></option> | ||
<option value='none' <?php echo $edmod2;?>><?php echo $clang->gT("No HTML editor");?></option> | ||
</select> | ||
</li> | ||
|
||
<li> | ||
<label for='questionselectormode'><?php echo $clang->gT("Question selector mode");?>:</label> | ||
<select id='questionselectormode' name='questionselectormode'> | ||
<option value='default'><?php echo $clang->gT("Default");?></option> | ||
<option value='full'<?php if ($this->session->userdata('questionselectormode')=="full"){ | ||
echo "selected='selected'";}?>><?php echo $clang->gT("Full question selector");?></option> | ||
<option value='none'<?php if ($this->session->userdata('questionselectormode')=="none"){ | ||
echo "selected='selected'";}?>><?php echo $clang->gT("Simple question selector");?></option> | ||
</select> | ||
</li> | ||
|
||
<li> | ||
<label for='templateeditormode'><?php echo $clang->gT("Template editor mode");?>:</label> | ||
<select id='templateeditormode' name='templateeditormode'> | ||
<option value='default'><?php echo $clang->gT("Default");?></option> | ||
<option value='full'<?php if ($this->session->userdata('templateeditormode')=="full"){ | ||
echo "selected='selected'";};?>><?php echo $clang->gT("Full template editor");?></option> | ||
<option value='none'<?php if ($this->session->userdata('templateeditormode')=="none"){ | ||
echo "selected='selected'";}?>><?php echo $clang->gT("Simple template editor");?></option> | ||
</select> | ||
</li> | ||
|
||
<li> | ||
<label for='dateformat'><?php echo $clang->gT("Date format");?>:</label> | ||
<select name='dateformat' id='dateformat'> | ||
<?php foreach (getDateFormatData() as $index=>$dateformatdata) | ||
{ | ||
echo "<option value='{$index}'"; | ||
if ($index==$this->session->userdata('dateformat')) | ||
{ | ||
echo "selected='selected'"; | ||
} | ||
|
||
echo ">".$dateformatdata['dateformat'].'</option>'; | ||
} ?> | ||
</select> | ||
</li> | ||
</ul> | ||
<p><input type='hidden' name='action' value='savepersonalsettings' /><input class='submit' type='submit' value='<?php echo $clang->gT("Save settings"); | ||
?>' /></p></form></div> |
Oops, something went wrong.