}
}
- if (!$conn instanceof DB_common) {
+ if (!is_object($conn)) {
+ // No object at all
+ throw new Exception('Fatal error: conn is no object.');
+ } elseif (!$conn instanceof DB_common) {
// Is not the right instance
throw new Exception('Cannot connect to database: ' . $conn->getMessage());
}
$data['email'] = $this->adminEmail;
}
try {
- $user = User::register($data);
+ $user = User::register($data, true); // true to skip email sending verification
} catch (Exception $e) {
return false;
}