id;
$webmaster = Webmaster::get($webmasterid);
include('xcrud/xcrud.php');
include ('lng/language.php');
!empty($_GET['lang']) ? $lng = new Language($_GET['lang']) : $lng = new Language();
$lng = $lng->getData();
$lngPage = $lng['config'];
$xcrud = Xcrud::get_instance();
$table = 'chat_config';
$xcrud->table($table);
$xcrud->pass_var('webmasterid', $webmasterid);
$xcrud->where('webmasterid =', $webmasterid);
$xcrud->fields('disableTOR, disableVPN, reportUserToAdmin, urlProtection, forbidCountries, warnUsersWhenAdminSpiesWebcam, adultRoomAction,
maxLenthMessage, maxLinesMessages, minorCanContactAdult', false);
$xcrud->label(array(
'disableTOR' => 'Disable TOR users',
'disableVPN' => 'Disable VPN users (paid version only)',
'reportUserToAdmin'=>'Report User to admin',
'forbidCountries'=>'Forbid countries',
'warnUsersWhenAdminSpiesWebcam'=>'Warn when admin spies an user',
'adultRoomAction'=>'Adult room action',
'maxLenthMessage'=>'Maximum Length of a message',
'maxLinesMessages'=>'Maxium number of lines in message (RETURN char)',
'minorCanContactAdult'=>'Can a minor contact an addult',
'urlProtection' => $lngPage['urlProtection' ]));
if ($webmaster->free || $webmaster->expired) {
$xcrud->disabled('disableTOR, disableVPN');
}
//$xcrud->validation_pattern('forbidCountries', '[a-zA-Z]{2}');
$xcrud->unset_add();
$xcrud->unset_list();
$xcrud->unset_title();
$xcrud->field_tooltip('reportUserToAdmin', "User can send an email to the admin to report another user's behaviour on chat.");
$xcrud->field_tooltip('urlProtection', $lngPage['urlProtectionL']);
$xcrud->field_tooltip('forbidCountries', 'Enter countries 2 letters code to be forbidden (separated by ,) Ex: fr, es, ru');
$xcrud->field_tooltip('adultRoomAction', "What to do if user enters an adult room.
If you want hide for minors, make sure you pass the parameter birthyear, which is the age of the user into the JWT encoding method");
$xcrud->field_tooltip('maxLenthMessage', "Maximum number of characters an user can send per message (protect against flooding)");
$xcrud->field_tooltip('maxLinesMessages', "Maximum number of RETURN character in a chat message (protect against flooding)");
$xcrud->field_tooltip('minorCanContactAdult', "Can minor contact an adult ? (make sure you pass the parameter birthyear, which is the age of the user into the JWT encoding method) ");
// $xcrud->emails_label(' email');
//$xcrud->show_primary_ai_column(true);
?>