Commit bca49a51 authored by cosine's avatar cosine

- Now showing the "change password" link in the user's

  page only if user authentication is managed by the
  "local" authority
parent d9fb1c61
......@@ -19,9 +19,15 @@
<li>#intranet-core.User_state#: @user_state;noquote@</li>
</else>
<if @local_authority_p@>
<if @admin@ eq 1 or @user_id@ eq @current_user_id@>
<li><a href="@change_pwd_url@">#intranet-core.lt_Update_this_users_pas#</a></li>
</if>
</if>
<else>
<li><%= [lang::message::lookup "" intranet-core.User_auth_by_LDAP "User authentication is handled by LDAP."] %><br>
<%= [lang::message::lookup "" intranet-core.User_auth_by_LDAP_change_pwd_there "Please change the password there."] %>
</else>
<if @otp_installed_p@>
<li><a href="@list_otp_pwd_url@">#intranet-otp.Print_OTP_list#</a><li>
</if>
......
......@@ -84,6 +84,18 @@ if {$otp_installed_p} {
set list_otp_pwd_url [export_vars -base $list_otp_pwd_base_url {user_id {return_url $current_url}}]
}
# Check if we are using a local authority or LDAP
set authority_short_name [db_string authority_short_name "
select min(short_name)
from auth_authorities
where authority_id in (select authority_id from users where user_id = :user_id)
" -default "local"]
set local_authority_p 0
if {"local" eq $authority_short_name} {set local_authority_p 1 }
set add_companies_p [im_permission $current_user_id add_companies]
set date_created [db_string get_date_created {}]
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