[ Index ]

PHP Cross Reference of GlotPress

title

Body

[close]

/scripts/ -> wipe-permissions.php (source)

   1  <?php
   2  require_once dirname( dirname( __FILE__ ) ) . '/gp-load.php';
   3  
   4  class GP_Script_Wipe_Permissions extends GP_CLI {
   5      
   6  	function run() {
   7          echo "This will erase all current permissions!\nAre you sure you want to delete them? [y/N]\n";
   8          $response = fgets( STDIN );
   9          if ( in_array( strtolower( trim( $response ) ), array( 'y', 'yes' ) ) ) {
  10              if ( GP::$permission->delete_all() ) {
  11                  echo "Permissions were deleted. Now you can use scripts/add-admin.php to add a new administrator.\n";
  12              } else {
  13                  $this->to_stderr( "Error in deleting permissions." );
  14                  exit( 1 );
  15              }
  16          } else {
  17              echo "Nothing was deleted.\n";
  18          }
  19      }
  20  }
  21  
  22  $gp_script_wipe_permissions = new GP_Script_Wipe_Permissions;
  23  $gp_script_wipe_permissions->run();


Generated: Thu May 24 03:59:35 2012 Hosted by follow the white rabbit.