Added Add Admin
This commit is contained in:
@@ -20,19 +20,19 @@ class Controller_User_Node extends Controller_Node {
|
||||
}
|
||||
|
||||
public function action_add() {
|
||||
$n = ORM::factory('NODE')->where('EMAIL_ADDRESS','=',$this->ao->email)->find_all();
|
||||
|
||||
if ($n->count() >= $this->ao->max_nodes) {
|
||||
SystemMessage::add(array(
|
||||
'title'=>_('Maximum nodes created'),
|
||||
'type'=>'info',
|
||||
'body'=>_('Additional nodes cannot be created for your account, you have already reached your maximum. If you really need more, please contact us.'),
|
||||
));
|
||||
|
||||
HTTP::redirect(URL::link('user','welcome'));
|
||||
}
|
||||
|
||||
if ($this->request->post()) {
|
||||
$n = ORM::factory('NODE')->where('EMAIL_ADDRESS','=',$this->ao->email)->find_all();
|
||||
|
||||
if (FALSE AND $n->count() > $this->ao->max_nodes) {
|
||||
SystemMessage::add(array(
|
||||
'title'=>_('Maximum nodes created'),
|
||||
'type'=>'info',
|
||||
'body'=>_('Additional nodes cannot be created for your account, you have already reached your maximum. If you really need more, please contact us.'),
|
||||
));
|
||||
|
||||
HTTP::redirect(URL::link('user','welcome'));
|
||||
}
|
||||
|
||||
// Find a free name.
|
||||
for ($i=1;$i<$n->count();$i++)
|
||||
if (! Object::in_array('NODE_NAME',$this->node_name($i),$n->as_array()))
|
||||
|
Reference in New Issue
Block a user