partial #1736
This commit is contained in:
parent
2165b8a80e
commit
8c0edd84d6
23
include/controllers/default/cockpit/test/recovery.php
Normal file
23
include/controllers/default/cockpit/test/recovery.php
Normal file
@ -0,0 +1,23 @@
|
||||
<?php
|
||||
error_reporting(0);
|
||||
class Controller_test_recovery extends Crunchbutton_Controller_Account {
|
||||
public function init() {
|
||||
$users = User::q( 'SELECT * FROM `user` u WHERE u.balanced_id IS NOT NULL AND uuid IS NULL' );
|
||||
foreach ( $users as $user ) {
|
||||
if( $user->balanced_id ){
|
||||
try {
|
||||
$balanced_id = $user->balanced_id;
|
||||
$account = Crunchbutton_Balanced_Account::byId( $balanced_id );
|
||||
if( $account->email_address ){
|
||||
$uuid = str_replace( '@_DOMAIN_' , '', $account->email_address );
|
||||
$user->uuid = $uuid;
|
||||
$user->save();
|
||||
echo '<pre>';var_dump( $user );exit();
|
||||
}
|
||||
} catch (Exception $e) {
|
||||
throw new Exception( 'Something really gone wrong', 0, $e);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
x
Reference in New Issue
Block a user