Implemented Login Message feature for superadmin only, advertising new Notifications section

This commit is contained in:
Nate Jones
2014-07-06 03:50:18 +00:00
parent 89b6a466aa
commit 061b07e863
9 changed files with 123 additions and 9 deletions
+42
View File
@@ -74,6 +74,48 @@ if (strlen($_SESSION['switch']['scripts']['dir']) > 0) {
unset($sql);
}
}
//ensure the login message is set
$sql = "delete from v_default_settings ";
$sql .= "where default_setting_category = 'login' ";
$sql .= "and default_setting_subcategory = 'message' ";
$db->exec(check_sql($sql));
unset($sql);
$sql = "select count(*) as num_rows from v_default_settings ";
$sql .= "where default_setting_category = 'login' ";
$sql .= "and default_setting_subcategory = 'message' ";
$sql .= "and default_setting_name = 'text' ";
$prep_statement = $db->prepare($sql);
if ($prep_statement) {
$prep_statement->execute();
$row = $prep_statement->fetch(PDO::FETCH_ASSOC);
if ($row['num_rows'] == 0) {
$sql = "insert into v_default_settings ";
$sql .= "(";
$sql .= "default_setting_uuid, ";
$sql .= "default_setting_category, ";
$sql .= "default_setting_subcategory, ";
$sql .= "default_setting_name, ";
$sql .= "default_setting_value, ";
$sql .= "default_setting_enabled, ";
$sql .= "default_setting_description ";
$sql .= ")";
$sql .= "values ";
$sql .= "(";
$sql .= "'".uuid()."', ";
$sql .= "'login', ";
$sql .= "'message', ";
$sql .= "'text', ";
$sql .= "'".$text['login-message_text']."', ";
$sql .= "'true', ";
$sql .= "'' ";
$sql .= ")";
$db->exec(check_sql($sql));
unset($sql);
}
}
}
}
+6
View File
@@ -79,4 +79,10 @@
$text['message-upgrade']['es-cl'] = "Actualización Completa";
$text['message-upgrade']['pt-pt'] = "Actualização Efectuada";
$text['message-upgrade']['fr-fr'] = "Mis à jour";
$text['login-message_text']['en-us'] = "Keep up with the FusionPBX project by configuring your preferences in the newly added <a href=''/app/notifications/notification_edit.php''>Notifications</a> section, under the System menu!";
$text['login-message_text']['es-cl'] = "Manténgase al día con el proyecto FusionPBX configurando sus preferencias en la sección <a href=''/app/notifications/notification_edit.php''>Notificaciones</a> acaba de agregar, en el menú del sistema!";
$text['login-message_text']['pt-pt'] = "Mantenha-se com o projeto FusionPBX configurando suas preferências na seção <a href=''/app/notifications/notification_edit.php''>Notificações</a> recém-adicionado, no menu Sistema!";
$text['login-message_text']['fr-fr'] = "Tenez-vous au projet FusionPBX en configurant vos préférences dans la section <a href=''/app/notifications/notification_edit.php''>Notifications</a> nouvellement ajouté, dans le menu du système!";
?>