Update register module for changes to the identity provider API.
This commit is contained in:
parent
0da1677951
commit
45277812b5
@ -61,7 +61,7 @@ class register_Controller extends Controller {
|
|||||||
} else {
|
} else {
|
||||||
print json_encode(
|
print json_encode(
|
||||||
array("result" => "error",
|
array("result" => "error",
|
||||||
"form" => $form->__toString()));
|
"form" => (string) $form));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -78,20 +78,14 @@ class register_Core {
|
|||||||
static function create_new_user($id) {
|
static function create_new_user($id) {
|
||||||
$user = ORM::factory("pending_user", $id);
|
$user = ORM::factory("pending_user", $id);
|
||||||
|
|
||||||
$password = md5(rand());
|
$password = md5(uniqid(mt_rand(), true));
|
||||||
$new_user = identity::create_user($user->name, $user->full_name, $password);
|
$new_user = identity::create_user($user->name, $user->full_name, $password, $user->email);
|
||||||
$new_user->email = $user->email;
|
|
||||||
$new_user->url = $user->url;
|
$new_user->url = $user->url;
|
||||||
$new_user->admin = false;
|
$new_user->admin = false;
|
||||||
$new_user->guest = false;
|
$new_user->guest = false;
|
||||||
$new_user->save();
|
$new_user->save();
|
||||||
|
|
||||||
$default_group = module::get_var("registration", "default_group");
|
$user->hash = md5(uniqid(mt_rand(), true));
|
||||||
if (!empty($default_group)) {
|
|
||||||
identity::add_user_to_group($new_user, $default_group);
|
|
||||||
}
|
|
||||||
|
|
||||||
$user->hash = md5(rand());
|
|
||||||
$user->state = 2;
|
$user->state = 2;
|
||||||
$user->save();
|
$user->save();
|
||||||
self::send_user_created_confirmation($user, $password);
|
self::send_user_created_confirmation($user, $password);
|
||||||
|
Reference in New Issue
Block a user