Commit 39aceaaf authored by Celine Noirot's avatar Celine Noirot

Add updatable password.

parent e2ad9fc0
......@@ -363,6 +363,7 @@ CREATE TABLE IF NOT EXISTS `fe_users` (
`tx_extbase_type` varchar(255) NOT NULL DEFAULT '',
`felogin_redirectPid` tinytext,
`felogin_forgotHash` varchar(80) DEFAULT '',
`tx_nG6_updatable_password` tinyint(1) NOT NULL DEFAULT '1',
PRIMARY KEY (`uid`),
KEY `parent` (`pid`,`username`),
KEY `username` (`username`),
......
......@@ -2473,21 +2473,21 @@ function get_project_runs($project_id, $orderby='', $limit='') {
/**
* Get all users with rights on the project.
*
* @param int $project_id the project id
*/
* Get all users with rights on the project.
*
* @param int $project_id the project id
*/
function get_all_users_on_project($project_id){
$users = array();
$queryParts = Array(
'SELECT' => 'fe_users.uid, fe_users.username, fe_users.lastlogin, fe_users.first_name, '
.' fe_users.last_name, fe_users.email, fe_rights.right_id, fe_users.cruser_id ',
'FROM' => 'fe_users INNER JOIN fe_rights ON fe_users.uid=fe_rights.fe_user_id ',
'WHERE' => 'fe_rights.project_id='.$project_id,
'GROUPBY' => '',
'ORDERBY' => '',
'LIMIT' => '',
);
'SELECT' => 'fe_users.uid, fe_users.username, fe_users.lastlogin, fe_users.first_name, '
.' fe_users.last_name, fe_users.email, fe_rights.right_id, fe_users.cruser_id , fe_users.tx_nG6_updatable_password',
'FROM' => 'fe_users INNER JOIN fe_rights ON fe_users.uid=fe_rights.fe_user_id ',
'WHERE' => 'fe_rights.project_id='.$project_id,
'GROUPBY' => '',
'ORDERBY' => '',
'LIMIT' => '',
);
$res = $GLOBALS['TYPO3_DB']->exec_SELECT_queryArray($queryParts);
$res_tab = array();
while($res_row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)) {
......@@ -2496,18 +2496,19 @@ function get_project_runs($project_id, $orderby='', $limit='') {
$lastlogin = date("d-m-Y", $res_row['lastlogin']);
$cruser_infos = tx_nG6_db::get_user_informations($res_row['cruser_id']);
if (!isset ($users['user_'.$user_id])){
$users['user_'.$user_id] = array(
'id' => $user_id,
'username' => $res_row['username'],
'lastlogin' => $lastlogin,
'first_name' => $res_row['first_name'],
'last_name' => $res_row['last_name'],
'email' => $res_row['email'],
'right_id' => $res_row['right_id'],
'cruser_id' => $res_row['cruser_id'],
'cruser_name' => $cruser_infos['username']
'id' => $user_id,
'username' => $res_row['username'],
'lastlogin' => $lastlogin,
'first_name' => $res_row['first_name'],
'last_name' => $res_row['last_name'],
'email' => $res_row['email'],
'right_id' => $res_row['right_id'],
'cruser_id' => $res_row['cruser_id'],
'cruser_name' => $cruser_infos['username'],
'updatable_password' => $res_row['tx_nG6_updatable_password']
);
}
......
......@@ -168,9 +168,11 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
{if ($user_values.cruser_id==$user_id)
|| $projects[key($projects)].is_admin
|| $projects[key($projects)].is_manager
|| ($user_values.id == $user_id ) }
|| ($user_values.id == $user_id )
|| $is_ng6_admin }
<td><center><input type="checkbox" id="chk_user_{$user_values.id}" value="user_{$user_values.id}" /></center>
<input type="hidden" id="chk_cruser_{$user_values.id}" value="{$user_values.cruser_id}"/></td>
<input type="hidden" id="chk_updatablepwd_{$user_values.id}" value="{$user_values.updatable_password}"/></td>
{else}
<td></td>
{/if}
......
......@@ -385,7 +385,8 @@ $(function () {
user_login = $.trim( $('#tr_user_' + user_id + ' td:eq(1)').text()),
first_name = $.trim( $('#tr_user_' + user_id + ' td:eq(5)').text()),
last_name = $.trim( $('#tr_user_' + user_id + ' td:eq(4)').text()),
email = $.trim( $('#tr_user_' + user_id + ' td:eq(6)').text());
email = $.trim( $('#tr_user_' + user_id + ' td:eq(6)').text()),
update_pwd=$("#chk_updatablepwd_" + user_id).val();
// get title laboratory and organism from ajax query
$.ajax({
......@@ -429,7 +430,7 @@ $(function () {
' <input type="text" id="email_val" class="form-control" name="email_val" placeholder="' + email + '"/>',
' </div>',
' </div>',
' <div class="form-group">',
' <div class="form-group" id="password-form">',
' <label class="col-sm-offset-2 col-sm-2 control-label">Password</label>',
' <div class="col-sm-8">',
' <div class="input-group">',
......@@ -474,7 +475,9 @@ $(function () {
// show modal box
$("#ng6modal").modal().ready(function() {
$("#error_message").hide();
if ( update_pwd == 0 ) {
$("#password-form").hide();
}
$('.group_typeahead').each(function(){
var $this = $(this);
$this.on('typeahead:selected', function(typeahead, item){
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment