Vanilla 1 is no longer supported or maintained. If you need a copy, you can get it here.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.
Password Reset
vanoob
New
Password Reset
0
This discussion has been closed.
Comments
does this work for sure
or is it a beta?
jw
thank you in advance
Some problems were encountered
Appending of permission definition to "\languages\English\definitions.php" for Password Reset 0.1 has failed.
Failed Password Reset 0.1 Installation!
Looking at the code it looks like it is attempting to manipulate the conf/language.php file. Aren't all customizations supposed to refrain from this? According to conf/readme.txt:
This file is not edited by Vanilla in any way. It's purpose is to allow you
to re-define language definitions made in
/languages/yourlanguage/definitions.php. You should NEVER edit the files in
your /languages folder. You should always copy the definition you want to
change into this file and edit it here.
I agree this should not be done, but the author is probably trying to save you some work.
Maybe set the permission to 777, let it do its thing then set it back, but do back it up first.
This is manifestation of lack of standardized way of managing extension translations.
That's the reason I made Extension Language Loader as a try to bring some "standard", so either language add-on maintainers can easily add extensions' translations either extension add-on maintaners can add whatever translations coming together with the extension add-on.
And i guess i must have put in the wrong description for error trapping, as i am only adding a definition to the conf/language.php.
And this is what the readme actually says about the language file. @ Klip, yes i understand what you mean, but not sure if you guys noticed, when an extension is disabled, the permissions still retain in the database and as such since the definitions are mentioned in the extension and the extension default isn't being read, the permissions definitions are null. So what i'm doing is just providing a descriptive prettified definition.
problem with using conf/language.php is, that it overrides any language definition defined before, so even I choose another then English language (and there is definition in another then English language), it will be always English.
Also in default.php on line 44 there is:
$Context->Dictionary['PERMISSION_USER_PASSWORD_RESET'] = 'Can Reset/Change any Account Password';
and it overrides that againI can see what you mean now so I tried to adjust your code so it would work as I think it should work.
You define definition in conf/language.php telling that extension is not enabled and in extension you change it so it says the definition without that 'not-enabled' notice.
I would recommend to do it little bit different.
I think you should add SetDefinition call in conf/language.php instead of seting the Dictionary definition directly. And in default.php you can do regexp replace of /\[.*\]\s*/ so it removes the notice in Dictionary. In this way it is still defined even the extension is disabled and if it is enabled it removes the "[!Extension Not Enabled] "
And it allows others to define translations of it.
Also I get this warning because my install is on linux
Warning: file_get_contents(/var/www/vanilla/\conf\language.php) [function.file-get-contents]: failed to open stream: No such file or directory in /var/www/vanilla/extensions/PasswordReset/default.php on line 54
there should be 'conf/language.php' at 54 and 56 lines instead of '\conf\langauge.php'. If it does problems on Windows there should be used DIRECTORY_SEPARATOR constant, which contains '/' or '\' depending on the system.
So here is diff of changes I did:
44,45c44,47 < $Context->Dictionary['PERMISSION_USER_PASSWORD_RESET'] = 'Can Reset/Change any Account Password'; < --- > if (isset( $Context->Dictionary['PERMISSION_USER_PASSWORD_RESET'] )) { > $Context->Dictionary['PERMISSION_USER_PASSWORD_RESET'] = preg_replace( '/\[.*\]\s*/', '', $Context->Dictionary['PERMISSION_USER_PASSWORD_RESET']); > } > 48,51c50,52 < $Language = "\n// Added for Password Reset Extension < \$Context->Dictionary['PERMISSION_USER_PASSWORD_RESET'] < = '[!Extension Not Enabled] Can Reset/Change any Account Password'; < "; --- > $Language = "\n// Added for Password Reset Extension > \$Context->SetDefinition( 'PERMISSION_USER_PASSWORD_RESET', '[!Extension Not Enabled] Can Reset/Change any Account Password' ); > "; 54,56c55,57 < $file = file_get_contents($Configuration['APPLICATION_PATH'].'\conf\language.php'); < if(!strpos($file, "\$Context->Dictionary['PERMISSION_USER_PASSWORD_RESET']")) { < if (!AppendToConfigurationFile($Configuration['APPLICATION_PATH'].'\conf\language.php', $Language)) { --- > $file = file_get_contents($Configuration['APPLICATION_PATH'].'conf/language.php'); > if(!strpos($file, "\$Context->SetDefinition( 'PERMISSION_USER_PASSWORD_RESET',")) { > if (!AppendToConfigurationFile($Configuration['APPLICATION_PATH'].'conf/language.php', $Language)) {
And just to affirm this for various people, the extension still writes to conf/language.php.
For all those who installed version 0.1 and want to make your vanilla install more friendly towards other languages as klip suggested. You will need to modify the conf/language.php file.
1. Find the following lines in conf/language.php // Added for Password Reset Extension $Context->Dictionary['PERMISSION_USER_PASSWORD_RESET'] = '[!Extension Not Enabled] Can Reset/Change any Account Password';
2. Replace them with // Added for Password Reset Extension $Context->SetDefinition('PERMISSION_USER_PASSWORD_RESET', '[!Extension Not Enabled] Can Reset/Change any Account Password');
termsofservice.php
Fatal error: Call to undefined method FauxContext::SetDefinition() in /conf/language.php on line 5
language.php:
<?php // Custom Language Definitions // Added for Password Reset Extension $Context->SetDefinition( 'PERMISSION_USER_PASSWORD_RESET', '[!Extension Not Enabled] Can Reset/Change any Account Password' ); // Added for Password Reset Extension $Context->SetDefinition( 'PERMISSION_USER_PASSWORD_RESET', '[!Extension Not Enabled] Can Reset/Change any Account Password' ); // Added for Password Reset Extension $Context->SetDefinition( 'PERMISSION_USER_PASSWORD_RESET', '[!Extension Not Enabled] Can Reset/Change any Account Password' ); // Added for Password Reset Extension $Context->SetDefinition( 'PERMISSION_USER_PASSWORD_RESET', '[!Extension Not Enabled] Can Reset/Change any Account Password' ); // Added for Password Reset Extension $Context->SetDefinition( 'PERMISSION_USER_PASSWORD_RESET', '[!Extension Not Enabled] Can Reset/Change any Account Password' ); // Added for Password Reset Extension $Context->SetDefinition( 'PERMISSION_USER_PASSWORD_RESET', '[!Extension Not Enabled] Can Reset/Change any Account Password' ); ?>
Now you've brought up something interesting for me, seems i may have neglected to update the proper error trapping for the initial install which lead to your multiple definition lines. I will fix this in the next release, also i'm not sure what exactly happens with multiple setdefinitions. maybe only the last line will be effective, but in any case remove those other uneeded lines.
--Edited
Masterwizards problem was observed when running password reset on php4, new version should now correct this.
So navigate to Settings->Roles & Permissions
Then you want to select the role that you want to give permissions to.
Scroll down the list and find "Can Reset/Change any Account Password" and tick the checkbox next to it. Save the permission settings for that role.
Then to reset the password of an account, all you have to do is make sure you are part of the role that can reset passwords, navigate to the account you want to reset. On the left hand menu you can find "reset password". click on that and follow the prompts.
NOTE: You can't reset your own password, this is to prevent hijacked accounts (ie public computer, remember me setting) from resetting the accounts password and steal your account. Also there is a list of user accounts that can't be reset (defaulted to first account created) which can be changed by editing the default.php file.
Hope that helps, a very long winded answer to a simple solution.