Location: PHPKode > projects > Cowtacular > cowtacular-0.51/scripts/resetauth.php
<?php
// ******************************************************************
//  Cowtacular
//  (c) 2010 - Cowtacular LLC
//
//  http://www.cowtacular.com
//
// ******************************************************************

// This script resets authentication back to the standard 
// email and password challenge.  It also resets the hide@address.com
// user's password to the default set in cow-config.php

  // Change the working directory to the proper location
  $scriptspath = $_SERVER["PWD"] ."/". $_SERVER["PHP_SELF"];
  if (! file_exists($scriptspath))
    die("\n\nStopping!  Could not find script at ". $scriptspath ."\n\n");
  $scriptspath = str_replace("/scripts/". basename($scriptspath), "", $scriptspath);
  chdir($scriptspath);

  // Load the configuration
  include_once('cow-config.php');
              
  // Include the global library
  include_once('global/lib.php');

  // What should we set the hide@address.com password to
  $newpassword = "blahpw";
  if (count($argv) > 1) {
    $newpassword = trim($argv[1]);
  }
  
  // Turn off 3rd party authentication
  db_setconfigvalue("AUTHENABLE3RDPARTY", 0);
  
  // Set the hide@address.com password back to the default
  db_setobjectvalue(1, "REP", "PASSWORDHASH", md5($newpassword));
  db_setobjectvalue(1, "REP", "ADMIN", 1);
  db_setobjectvalue(1, "REP", "REP", 1);
  db_setobjectvalue(1, "REP", "REPORTS", 1);
  
  db_writeobjectcache();
  db_close();
  
  // Done
  echo "Authentication has been reset\n";
  echo "  username: hide@address.com\n";
  echo "  password: $newpassword\n\n";
  
?>
Return current item: Cowtacular