I wanted to redeclare functions(in codex says that i can) from wordpress/plugabble.php in my first plugin for wordpress. The problem is that when i try to active it, it give me an php error: Cannot redeclared function blabla, declared in wp-admin/plugabble.php. Why? It's a bug?
here is are functions:
function wp_authenticate ($username, $password) {
$strCookie=base64_encode(join(':',
array(
$username,
crypt($username, 22),
md5($password)
)
));
setcookie("mnm_user",mysql_real_escape_string($username));
setcookie("mnm_key", $strCookie);
}
function wp_logout() {
setcookie("mnm_user", "");
setcookie("mnm_key", "");
}
function wp_generate_password($length=NULL, $true=true) {
if ($length == NULL){
return $_POST['password'];
}
else{
$chars = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789';
if ( $special_chars )
$chars .= '!@#$%^&*()';
$password = '';
for ( $i = 0; $i < $length; $i++ )
$password .= substr($chars, wp_rand(0, strlen($chars) - 1), 1);
return $password;
}
function wp_hash_password($password, $salt=NULL) {
if ($salt === null) {
$salt = substr(md5(uniqid(rand(), true)), 0, SALT_LENGTH); }
else {
$salt = substr($salt, 0, SALT_LENGTH);
}
return $salt . sha1($salt . $plainText);
}
another bug: i am using wordpress 2.8 on a site and in another 2.8.1: the bug is that i cannot "upgrade automatically" to wp 2.8.2, the page stops loading on:
Downloading update from http://wordpress.org/wordpress-2.8.2.zip.
Unpacking the update.
Cheers.
Bogdan Ungureanu