Disable change password from user backend

Ask all your questions regarding OC 6.x Please read the Support Forum Rules
Forum rules
ownCloud 6.x reached end of life and is officially unsupported. For details see Wiki page.

Please upgrade your ownCloud.
thorpedo
Newbie
Posts: 3
Joined: Tue Mar 25, 2014 1:53 pm
ownCloud version: 6.0.2
Webserver: Apache
Database: PostgreSQL
OS: Linux
PHP version: 5.4

Disable change password from user backend

Postby thorpedo » Tue Mar 25, 2014 2:40 pm

We are developing a custom user backend based on user_cas app. We want disable from "personal" page change password action. We saw in some github tickets , template manage which part of this page with implementsActions check. Also we see user_ldap to perform this operation define a own implementsActions method.

We define our implementsActions like user_ldap app but doesn't work. We put some debug lines and see this:

{"app":"cas","message":"implementsActions :256","level":0,"time":"2014-03-25T11:29:48+00:00"}
{"app":"cas","message":"supported actions 69889","level":0,"time":"2014-03-25T11:29:48+00:00"}


Code: Select all

class OC_USER_CAS extends OC_User_Backend {
...
....
    public function implementsActions($actions) {
                OC_Log::write('cas','implementsActions :'.$actions, OC_Log::DEBUG);
                return (bool)((OC_USER_BACKEND_CHECK_PASSWORD
                        | OC_USER_BACKEND_GET_HOME
                        | OC_USER_BACKEND_GET_DISPLAYNAME
                        | OC_USER_BACKEND_PROVIDE_AVATAR
                        | OC_USER_BACKEND_COUNT_USERS)
                        & $actions);

        }



How can fix this issue?

User avatar
RandolphCarter
ownCloud master
Posts: 5134
Joined: Wed May 30, 2012 8:42 am
ownCloud version: 8.1.1
Webserver: Apache
Database: MySQL
OS: Linux
PHP version: 5.5.x

Re: Disable change password from user backend

Postby RandolphCarter » Tue Mar 25, 2014 3:23 pm

Hm, if what you show is all there is in the log, then there doesn't seem to be a check for whether the password can be set or not - because that should be $action = 16, see the xxx_SET_PASSWORD constant defined here: https://github.com/owncloud/core/blob/4 ... nd.php#L35

And whats this "supported actions" log entry about, where does it come from, is it also produced by your app?

thorpedo
Newbie
Posts: 3
Joined: Tue Mar 25, 2014 1:53 pm
ownCloud version: 6.0.2
Webserver: Apache
Database: PostgreSQL
OS: Linux
PHP version: 5.4

Re: Disable change password from user backend

Postby thorpedo » Tue Mar 25, 2014 4:01 pm

@RandolphCarter , i put some OC_Log sentences to try to debug problem, "supported actions" is the output from getSupportedActions.

Code: Select all

OC_Log::write('cas','supported actions '.$this->getSupportedActions(), OC_Log::DEBUG);


What's it's the correct implementation to disable some operations ? Create like user_ldap and a ImplementsActions function? Another way to disable some parts from personal settings?


Thanks for your response

User avatar
RandolphCarter
ownCloud master
Posts: 5134
Joined: Wed May 30, 2012 8:42 am
ownCloud version: 8.1.1
Webserver: Apache
Database: MySQL
OS: Linux
PHP version: 5.5.x

Re: Disable change password from user backend

Postby RandolphCarter » Tue Mar 25, 2014 4:19 pm

Well the getSupportedAction method checks for whether methods exist. So to me it seems one possibility could be just not to have a setPassword function maybe?

About the "correct" way of doing it, you'd have to ask on the mailing list by the way. Here, developers aren't around very often, it's mostly "just" users...

thorpedo
Newbie
Posts: 3
Joined: Tue Mar 25, 2014 1:53 pm
ownCloud version: 6.0.2
Webserver: Apache
Database: PostgreSQL
OS: Linux
PHP version: 5.4

Re: Disable change password from user backend

Postby thorpedo » Tue Mar 25, 2014 4:29 pm

@RandolphCarter thanks , i ask this problem on the maillist .

Thanks a lot!

MU7L3Y
Helpful Elf
Posts: 121
Joined: Wed Oct 09, 2013 4:02 am
ownCloud version: 7.0.2
Webserver: Apache
Database: MySQL
OS: Linux Hosting Package
PHP version: 5.5.14

Re: Disable change password from user backend

Postby MU7L3Y » Wed Mar 26, 2014 12:08 am

I would also like to know how to disable the users ability to change the password. If you find how to do this, please let me know. Thanks

User avatar
RandolphCarter
ownCloud master
Posts: 5134
Joined: Wed May 30, 2012 8:42 am
ownCloud version: 8.1.1
Webserver: Apache
Database: MySQL
OS: Linux
PHP version: 5.5.x

Re: Disable change password from user backend

Postby RandolphCarter » Wed Mar 26, 2014 12:14 am

I would also like to know how to disable the users ability to change the password.

Are you also referring to that in the context of your own authentication app? Or in general? If in general, I'd recommend to open a separate topic, as this thread is about how to do it when building one's own auth app.

MU7L3Y
Helpful Elf
Posts: 121
Joined: Wed Oct 09, 2013 4:02 am
ownCloud version: 7.0.2
Webserver: Apache
Database: MySQL
OS: Linux Hosting Package
PHP version: 5.5.14

Re: Disable change password from user backend

Postby MU7L3Y » Thu Mar 27, 2014 12:06 am

RandolphCarter wrote:
I would also like to know how to disable the users ability to change the password.

Are you also referring to that in the context of your own authentication app? Or in general? If in general, I'd recommend to open a separate topic, as this thread is about how to do it when building one's own auth app.

I see. I was meaning in general..

daniel314
Beginner
Posts: 22
Joined: Sat May 24, 2014 3:30 pm
ownCloud version: 7.0.3
Webserver: Apache
Database: MySQL
OS: Linux
PHP version: 5.4.16

Re: Disable change password from user backend

Postby daniel314 » Mon May 26, 2014 4:00 pm

If someone want to disable "Change Password" from User Backend in General, then you have to comment out the following Line at settings/personal.php:

$tmpl->assign('passwordChangeSupported', OC_User::canUserChangePassword(OC_User::getUser()));


Cheers,

Daniel

MU7L3Y
Helpful Elf
Posts: 121
Joined: Wed Oct 09, 2013 4:02 am
ownCloud version: 7.0.2
Webserver: Apache
Database: MySQL
OS: Linux Hosting Package
PHP version: 5.5.14

Re: Disable change password from user backend

Postby MU7L3Y » Thu May 29, 2014 3:28 am

great, thanks for that Daniel!


  • Similar Topics
    Replies
    Views
    Last post

Return to “ownCloud Community Edition 6.x”

Who is online

Users browsing this forum: Baidu [Spider] and 1 guest