Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- function dirDel($dir)
- {
- if ($objs = glob($dir."/*")) {foreach($objs as $obj) {is_dir($obj) ? dirDel($obj) : unlink($obj);}}
- if(file_exists($dir)) rmdir($dir);
- }
- $host = 'localhost';
- $db = 'bitrix_67';
- $charset = 'utf-8';
- $user = 'rooot2';
- $pass = 'RootPass';
- $dsn = "mysql:host=$host;dbname=$db";
- $new_db_key = 'FVkQfGYUBgYtCUVcABcCCgsTAQ==';
- $new_file_key = 'ARtqeQYHb2MMdAgebRtkG2sA';
- $new_lic_key = 'S16-NA-V3WT2OPONA2GDTD5';
- $opt = array(
- PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION,
- PDO::ATTR_DEFAULT_FETCH_MODE => PDO::FETCH_ASSOC
- );
- try {
- $pdo = new PDO($dsn, $user, $pass, $opt);
- $stmt = $pdo->query('SELECT `VALUE` FROM b_option WHERE `NAME` = "admin_passwordh"');
- echo "\n<br> DB_KEY:\n<br>";
- while ($row = $stmt->fetch())
- {
- echo var_dump($row) . "\n<br>";
- }
- $stmt = $pdo->query('UPDATE `b_option` SET `VALUE` = "'.$new_db_key.'" WHERE `NAME`="admin_passwordh"');
- $stmt->execute();
- } catch (PDOException $e) {
- die('Подключение не удалось: ' . $e->getMessage());
- }
- echo "\n<br> DEFINE_KEY:\n<br>";
- if(file_exists("./bitrix/modules/main/admin/define.php"))
- {
- $f = fopen("./bitrix/modules/main/admin/define.php","r+");
- if($f) {
- while(!feof($f)) echo "\n".htmlspecialchars(fgets($f));
- ftruncate($f,0);
- rewind($f);
- fwrite($f,'<?define("TEMPORARY_CACHE", "'.$new_file_key.'");?>');
- fclose($f);
- }
- }
- echo "\n<br> LICENSE_KEY:\n<br>";
- if(file_exists("./bitrix/license_key.php"))
- {
- $f = fopen("./bitrix/license_key.php","r+");
- if($f) {
- while(!feof($f)) echo "\n".htmlspecialchars(fgets($f));
- ftruncate($f,0);
- rewind($f);
- fwrite($f,'<? $LICENSE_KEY = "'.$new_lic_key.'"; ?>');
- fclose($f);
- }
- }
- dirDel("./bitrix/managed_cache/*");
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement