Activate wpmu user while email server not working
My email server seem not working to send activation email to student for their new blog . I need quick solution that able to activate the blog and able to reset the password for temporary solution so I can investigate problem in my email server.
To overcome the problem I make this script :
activate.php
mysql_connect("localhost","alam","doyanmakan");
mysql_select_db("wpmu");
if($_GET['ac']=='reset'){
$user2=base64_decode($_GET['us']);
//update db
$ubah=mysql_query("update wp_users set user_pass=md5('123456') where user_login='$user2'");
if($ubah){
echo "Success reset the password into : <b>123456</b>";
}
}
?>
<html>
<head>
<meta http-equiv="Content-Language" content="en-us">
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>Instant Blog Activation</title>
</head>
<body>
<p>Instant Blog Activation
</p>
<table border="1" width="79%">
<tr>
<td width="39" align="center">No</td>
<td width="122" align="center">Name</td>
<td width="121" align="center">Blog</td>
<td width="219" align="center">Email</td>
<td align="center">Action</td>
</tr>
<?php
$query=mysql_query("select domain,user_login,activation_key,user_email from wp_signups where active=0");
$no=1;
while(list($domain,$login,$key,$email)=mysql_fetch_row($query)){
?>
<tr>
<td width="39"><?php echo $no;?></td>
<td width="122"><?php echo $login;?></td>
<td width="121" align="center"><?php echo $domain;?></td>
<td width="219"><?php echo $email;?></td>
<td><a href="http://blog.yourdomain.com/wp-activate.php?key=<?php echo $key;?>">Activate</a> | <a href="activate.php?ac=reset&amp;us=<?php echo base64_encode($login);?>">Reset Password</a></td>
</tr>
<?php
$no++;
}
?>
</table>
</body>
</html>
I hope I can fix email server as fast as I can
Related Reading:
Using DrupalWith the recipes in this book, you can take full advantage of the vast collection of community-contributed modules that make the Drupal web framewo... Read More >
Drupal For DummiesLearn to set up, manage, and administer a Drupal Web site
Drupal offers unparalleled flexibility for content-managed Web sites, but most ... Read More >
Pro Drupal Development, Second EditionWidely praised for its in–depth coverage of Drupal internals, bestselling Pro Drupal Development has been completely updated for Drupal 6 in thi... Read More >
Front End Drupal: Designing, Theming, Scripting“For Drupal to succeed, we need books like this.”
–Dries Buytaert, Drupal founder and project... Read More >
Cracking Drupal: A Drop in the BucketThe first book to reveal the vulnerabilities and security issues that exist in the sites that have been built with Drupal?and how to prevent them from... Read More >
Search Terms :
If you enjoyed this post, please consider to leave a comment or subscribe to the feed and get future articles delivered to your feed reader.
