mirror of
https://github.com/stylersnico/librenms.git
synced 2026-07-28 08:02:41 +02:00
Fix coding style part 2
This commit is contained in:
@@ -4,12 +4,12 @@
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>. */
|
||||
|
||||
@@ -44,35 +44,43 @@ if(!empty($name)) {
|
||||
}
|
||||
if(dbUpdate(array('rule_id' => mres($_REQUEST['rule_id']), 'name' => $name), "alert_templates", "id = ?", array($_REQUEST['template_id']))) {
|
||||
$ok = "Updated template and rule id mapping";
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
$error ="Failed to update the template and rule id mapping";
|
||||
}
|
||||
} elseif( $_REQUEST['template'] && is_numeric($_REQUEST['template_id']) ) {
|
||||
}
|
||||
elseif( $_REQUEST['template'] && is_numeric($_REQUEST['template_id']) ) {
|
||||
//Update template-text
|
||||
|
||||
if($ret = dbUpdate(array('template' => $_REQUEST['template'], 'name' => $name), "alert_templates", "id = ?", array($_REQUEST['template_id']))) {
|
||||
$ok = "Updated template";
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
$error = "Failed to update the template";
|
||||
}
|
||||
} elseif( $_REQUEST['template'] ) {
|
||||
}
|
||||
elseif( $_REQUEST['template'] ) {
|
||||
//Create new template
|
||||
|
||||
if(dbInsert(array('template' => $_REQUEST['template'], 'name' => $name), "alert_templates")) {
|
||||
$ok = "Alert template has been created.";
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
$error = "Could not create alert template";
|
||||
}
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
$error = "We could not work out what you wanted to do!";
|
||||
}
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
$error = "You haven't given your template a name, it feels sad :( - $name";
|
||||
}
|
||||
|
||||
if(!empty( $ok )) {
|
||||
die("$ok");
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
die("ERROR: $error");
|
||||
}
|
||||
?>
|
||||
|
||||
Reference in New Issue
Block a user