Created
December 20, 2013 20:43
-
-
Save init90/b7ed6dee23fd2232e56c to your computer and use it in GitHub Desktop.
Відновлення паролю в drupal 7
Додати в корінь сайту з назвою наприклад pass.php, тоді виконати його так site.name/?pass='new_pass'
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
define('DRUPAL_ROOT', getcwd()); | |
require_once DRUPAL_ROOT . '/includes/bootstrap.inc'; | |
drupal_bootstrap(DRUPAL_BOOTSTRAP_FULL); | |
require_once DRUPAL_ROOT . '/' . variable_get('password_inc', 'includes/password.inc'); | |
$admin = user_load(1); | |
$pass = isset($_GET['pass'])? trim($_GET['pass']): 'pass'; | |
$uid = isset($_GET['uid'])? trim($_GET['uid']): 1; | |
user_save($admin, array('pass' => $pass)); | |
$account = user_load($uid); | |
if(user_check_password($pass, $account)){ | |
echo "[OK]"; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment