PHP 8.2.30
Preview: update_pass.php Size: 2.02 KB
/var/softaculous/admidio/update_pass.php

<?php

@unlink('update_pass.php');

$options = array('cost' => 10);
$gPasswordHashAlgorithm = 'DEFAULT';

define('HASH_ALGORITHM_DEFAULT','DEFAULT');
define('HASH_ALGORITHM_ARGON2ID','ARGON2ID');
define('HASH_ALGORITHM_ARGON2I','ARGON2I');
define('HASH_ALGORITHM_BCRYPT','BCRYPT');
define('HASH_ALGORITHM_SHA512','SHA512');
define('HASH_INDICATOR_SHA512','$6$');
define('HASH_COST_SHA512_DEFAULT',100000);
define('HASH_COST_SHA512_MIN',25000);
define('HASH_COST_BCRYPT_DEFAULT',PASSWORD_BCRYPT_DEFAULT_COST);
define('HASH_COST_BCRYPT_MIN',8);

function __hash($password, $algorithm = HASH_ALGORITHM_DEFAULT, array $options = array())
{
	$options = __getPreparedOptions($algorithm, $options);

	switch ($algorithm) {
		case HASH_ALGORITHM_DEFAULT:
			$algorithmPhpConstant = PASSWORD_DEFAULT;
			break;
		case HASH_ALGORITHM_ARGON2ID:
			$algorithmPhpConstant = PASSWORD_ARGON2ID;
			break;
		case HASH_ALGORITHM_ARGON2I:
			$algorithmPhpConstant = PASSWORD_ARGON2I;
			break;
		case HASH_ALGORITHM_BCRYPT:
			$algorithmPhpConstant = PASSWORD_BCRYPT;
			break;
		case HASH_ALGORITHM_DEFAULT:
			$algorithmPhpConstant = PASSWORD_DEFAULT;
			break;
		case HASH_ALGORITHM_SHA512:
			$salt = '[[salt]]';
			return crypt($password, HASH_INDICATOR_SHA512 . 'rounds=' . $options['cost'] . '$' . $salt . '$');
		default:
			$algorithmPhpConstant = PASSWORD_DEFAULT;
	}

	return password_hash($password, $algorithmPhpConstant, $options);
}

function __getPreparedOptions($algorithm, array $options)
{
	if ($algorithm === HASH_ALGORITHM_SHA512) {
		$defaultCost = HASH_COST_SHA512_DEFAULT;
		$minCost     = HASH_COST_SHA512_MIN;
	} elseif ($algorithm === HASH_ALGORITHM_BCRYPT || ($algorithm === HASH_ALGORITHM_DEFAULT && PASSWORD_DEFAULT === PASSWORD_BCRYPT)) {
		$defaultCost = HASH_COST_BCRYPT_DEFAULT;
		$minCost     = HASH_COST_BCRYPT_MIN;
	} else {
		$options['cost'] = null;
		return $options;
	}
	
	$options = array('cost' => 10);
	return $options;
}

$resp = __hash('[[admin_pass]]', $gPasswordHashAlgorithm, $options);
echo '<update_pass>'.$resp.'</update_pass>';

?>

Directory Contents

Dirs: 6 × Files: 18

Name Size Perms Modified Actions
images DIR
- drwxr-xr-x 2026-03-16 21:03:32
Edit Download
php53 DIR
- drwxr-xr-x 2026-03-16 21:03:32
Edit Download
php56 DIR
- drwxr-xr-x 2026-03-16 21:03:32
Edit Download
php71 DIR
- drwxr-xr-x 2026-03-16 21:03:32
Edit Download
php81 DIR
- drwxr-xr-x 2026-03-16 21:03:32
Edit Download
php82 DIR
- drwxr-xr-x 2026-03-16 21:03:32
Edit Download
98.87 KB lrw-r--r-- 2026-03-16 10:30:36
Edit Download
15.08 MB lrw-r--r-- 2026-03-16 10:30:36
Edit Download
6.32 KB lrw-r--r-- 2026-03-16 10:50:12
Edit Download
1.15 KB lrw-r--r-- 2025-11-17 12:32:18
Edit Download
4.63 KB lrw-r--r-- 2026-03-16 10:50:12
Edit Download
433 B lrw-r--r-- 2024-01-09 12:25:12
Edit Download
3.30 KB lrw-r--r-- 2026-03-16 10:50:12
Edit Download
177 B lrw-r--r-- 2026-03-09 08:40:52
Edit Download
4.24 KB lrw-r--r-- 2026-03-16 10:50:12
Edit Download
2.92 KB lrw-r--r-- 2026-03-16 10:30:36
Edit Download
921 B lrw-r--r-- 2021-12-23 11:54:36
Edit Download
5.12 KB lrw-r--r-- 2026-03-16 10:50:12
Edit Download
28.10 KB lrw-r--r-- 2025-11-17 12:32:18
Edit Download
2.77 KB lrw-r--r-- 2026-03-16 10:50:12
Edit Download
686 B lrw-r--r-- 2025-11-17 12:32:18
Edit Download
2.02 KB lrw-r--r-- 2023-02-13 10:56:44
Edit Download
5.99 KB lrw-r--r-- 2026-03-16 10:50:12
Edit Download
346 B lrw-r--r-- 2025-11-17 12:32:18
Edit Download

If ZipArchive is unavailable, a .tar will be created (no compression).