Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
genotoul-bioinfo
ng6
Commits
39aceaaf
Commit
39aceaaf
authored
Mar 21, 2017
by
Celine Noirot
Browse files
Add updatable password.
parent
e2ad9fc0
Changes
4
Hide whitespace changes
Inline
Side-by-side
bin/ng6_database.sql
View file @
39aceaaf
...
...
@@ -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`
),
...
...
ui/nG6/lib/class.tx_nG6_db.php
View file @
39aceaaf
...
...
@@ -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'
]
);
}
...
...
ui/nG6/pi1/project_view.tpl
View file @
39aceaaf
...
...
@@ -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
}
...
...
ui/nG6/res/js/tx_nG6_pi1.js
View file @
39aceaaf
...
...
@@ -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
){
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment