function delayedload(){";
if(is_logged_in() && is_verified()){
echo "runWhenExists('ServerPing');";
}
if(has_flag($user,'u')){
echo "runWhenExists('FetchMemos');";
echo "runWhenExists('FetchNews');";
echo "runWhenExists('FetchChannels');";
}
echo "};";
if(has_flag($user,'u')){ ?>
'memo-diag',
'type'=>'form',
'form_id'=>'memo',
'form_submit_label'=>__('Send'),
'form_fields'=>array(
array(
'name'=>'to',
'label'=>__('To'),
'type'=>'string',
'value'=>''
),
array(
'name'=>'message',
'label'=>__('Message'),
'type'=>'string',
'value'=>''
),
array(
'name'=>'action',
'type'=>'hidden',
'value'=>'send-memo'
)
)
));
array_push($dialogs,array(
'id'=>'channel-diag',
'type'=>'form',
'form_id'=>'channel',
'form_submit_label'=>__('Register'),
'form_fields'=>array(
array(
'name'=>'channel',
'label'=>__('Channel Name'),
'type'=>'string',
'value'=>''
),
array(
'name'=>'action',
'type'=>'hidden',
'value'=>'register-channel'
)
)
));
array_push($dialogs,array(
'id'=>'channel-flags-diag',
'type'=>'form',
'form_id'=>'channel-flags',
'form_submit_label'=>__('Modify'),
'form_fields'=>array(
array(
'name'=>'user',
'label'=>__('User'),
'type'=>'string',
'value'=>''
),
array(
'name'=>'flags',
'label'=>__('Flags'),
'type'=>'multi',
'values'=>array(
channel_flag_obj('A'),
channel_flag_obj('F'),
channel_flag_obj('O'),
channel_flag_obj('R'),
channel_flag_obj('V'),
channel_flag_obj('a'),
channel_flag_obj('f'),
channel_flag_obj('h'),
channel_flag_obj('i'),
channel_flag_obj('o'),
channel_flag_obj('q'),
channel_flag_obj('r'),
channel_flag_obj('s'),
channel_flag_obj('t'),
channel_flag_obj('v'),
channel_flag_obj('b')
)
),
array(
'name'=>'channel',
'type'=>'hidden',
'value'=>''
),
array(
'name'=>'action',
'type'=>'hidden',
'value'=>'channel-flags'
)
)
));
} ?>
Enable 2-factor Authentication'.get_form_html('2-factor',array(
array(
'name'=>'country-code',
'label'=>__('Country'),
'type'=>'text',
'attributes'=>array(
'id'=>'authy-countries'
)
),
array(
'name'=>'cellphone',
'label'=>__('Cell #'),
'type'=>'text',
'attributes'=>array(
'id'=>'authy-cellphone'
)
),
array(
'name'=>'action',
'type'=>'hidden',
'value'=>'2-factor-register'
)
),'Submit').'
';
break;
case 'google-authenticator':
$api = get_api();
$_SESSION['secret_key'] = $api->createSecret();
echo '
';
break;
default:
}
}else{
switch(get_conf('2-factor-method')){
case 'authy':case 'google-authenticator':
echo "
";
break;
default:
}
}
if(get_conf('persona-endpoint') != 'none'){
echo "
".__('Link Persona')." ";
$emails = get_emails($user['id'],true);
foreach($emails as $k => $email){
echo "
{$email['email']}
";
}
}
}
?>
'newpass-diag',
'type'=>'form',
'form_id'=>'newpass',
'form_submit_label'=>__('Change Password'),
'form_fields'=>array(
array(
'name'=>'password',
'label'=>__('Password'),
'type'=>'password',
'value'=>''
),
array(
'name'=>'newpass',
'label'=>__('New Password'),
'type'=>'password',
'value'=>''
),
array(
'name'=>'action',
'type'=>'hidden',
'value'=>'newpass'
)
)
));
$roles = array(array(
'value'=>'user',
'label'=>__('User')
));
if($res = query("SELECT rt.name AS value,rt.description AS label FROM user_role_types rt JOIN user_roles r ON r.user_role_id = rt.id JOIN users u ON r.user_id = u.id WHERE u.id = %d",array($user['id']))){
while($role = $res->fetch_assoc()){
array_push($roles,$role);
}
}
array_push($dialogs,array(
'id'=>'roles-diag',
'type'=>'form',
'form_id'=>'roles',
'form_submit_label'=>__('Switch'),
'form_fields'=>array(
array(
'name'=>'type',
'label'=>__('Type'),
'type'=>'select',
'values'=>$roles,
'value'=>isset($_COOKIE['type'])?$_COOKIE['type']:'user'
),
array(
'name'=>'action',
'type'=>'hidden',
'value'=>'role'
)
)
));
}elseif($user && !$flag){
array_push($dialogs,array(
'id'=>'verify-diag',
'type'=>'form',
'autocomplete'=>'off',
'form_id'=>'verify',
'form_submit_label'=>__('Login'),
'form_fields'=>array(
array(
'name'=>'token',
'label'=>__('2-Factor Verification'),
'type'=>'text',
'attributes'=>array(
'id'=>'authy-token',
'style'=>'background-color:#F2DEDE;'
)
),
array(
'name'=>'action',
'type'=>'hidden',
'value'=>'verify'
)
)
));
}else{
$roles = array(array(
'value'=>'user',
'label'=>__('User')
));
if($res = query("SELECT name AS value,description AS label FROM ircd.user_role_types")){
while($role = $res->fetch_assoc()){
array_push($roles,$role);
}
}
array_push($dialogs,array(
'id'=>'login-diag',
'type'=>'form',
'form_id'=>'login',
'form_submit_label'=>__('Login'),
'form_fields'=>array(
array(
'type'=>'custom',
'html'=>get_conf('persona-endpoint') != 'none'?"