}
}
+ /**
+ * @brief Check whether user can change his password
+ * @param $uid The username
+ * @returns true/false
+ *
+ * Check whether a specified user can change his password
+ */
+ public static function canUserChangePassword($uid) {
+ foreach(self::$_usedBackends as $backend) {
+ if($backend->implementsActions(OC_USER_BACKEND_SET_PASSWORD)) {
+ if($backend->userExists($uid)) {
+ return true;
+ }
+ }
+ }
+ return false;
+ }
+
/**
* @brief Check if the password is correct
* @param $uid The username
$tmpl->assign('usage_relative', $storageInfo['relative']);
$tmpl->assign('email', $email);
$tmpl->assign('languages', $languages);
+$tmpl->assign('passwordChangeSupported', OC_User::canUserChangePassword(OC_User::getUser()));
$forms=OC_App::getForms('personal');
$tmpl->assign('forms', array());
<a class="button" href="https://itunes.apple.com/us/app/owncloud/id543672169?mt=8" target="_blank"><?php echo $l->t('Download iOS Client');?></a>
</fieldset>
-
+<?php
+if($_['passwordChangeSupported']) {
+?>
<form id="passwordform">
<fieldset class="personalblock">
<legend><strong><?php echo $l->t('Password');?></strong></legend>
<input id="passwordbutton" type="submit" value="<?php echo $l->t('Change password');?>" />
</fieldset>
</form>
+<?php
+}
+?>
<form id="lostpassword">
<fieldset class="personalblock">