-
Notifications
You must be signed in to change notification settings - Fork 31
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
nodesettingschanges #53
Changes from all commits
d767b7c
6a5768d
1e765e3
14128eb
144d9a7
db0a681
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,79 @@ | ||
<?php | ||
/* | ||
* WiND - Wireless Nodes Database | ||
* | ||
* Copyright (C) 2012 Leonidas Papadopoulos <[email protected]> | ||
* | ||
* This program is free software; you can redistribute it and/or modify | ||
* it under the terms of the GNU General Public License as published by | ||
* the Free Software Foundation; version 2 dated June, 1991. | ||
* | ||
* 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, write to the Free Software | ||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA | ||
* | ||
*/ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We are using GPLv3 not v2 license. Check another existing file and copy/paste |
||
|
||
class node_editor_nodesettingschanges { | ||
|
||
var $tpl; | ||
function __construct() { | ||
|
||
} | ||
|
||
function node_editor_nodesettingschanges() { | ||
|
||
} | ||
|
||
function form_nodesettingschanges() { | ||
global $main, $db, $vars, $lang; | ||
$form_nodesettingschanges = new form(array('FORM_NAME' => 'form_nodesettingschanges')); | ||
|
||
$form_nodesettingschanges->db_data('nodesettingschanges.uid, nodesettingschanges.nodeid, nodesettingschanges.dateline, | ||
nodesettingschanges.changemade, nodesettingschanges.changemenu, nodesettingschanges.reason, nodesettingschanges.comment'); | ||
$form_nodesettingschanges->data[1]['value']= intval(get('node')); | ||
$uid=$main->userdata->user; | ||
$form_nodesettingschanges->data[0]['value']= $uid; | ||
$form_nodesettingschanges->data[2]['value']= date("Y-m-d H:i:s"); | ||
|
||
return $form_nodesettingschanges; | ||
} | ||
|
||
function output() { | ||
if ($_SERVER['REQUEST_METHOD'] == 'POST' && method_exists($this, 'output_onpost_'.$_POST['form_name'])) return call_user_func(array($this, 'output_onpost_'.$_POST['form_name'])); | ||
global $construct; | ||
$this->tpl['nodesettingschanges_method'] = (get('nodesettingschange') == 'add' ? 'add' : 'edit' ); | ||
$this->tpl['form_nodesettingschanges'] = $construct->form($this->form_nodesettingschanges(), __FILE__); | ||
return template($this->tpl, __FILE__); | ||
} | ||
|
||
function output_onpost_form_nodesettingschanges() { | ||
global $construct, $main, $db; | ||
$form_nodesettingschanges = $this->form_nodesettingschanges(); | ||
#$nameserver = get('nameserver'); | ||
#if (get('nameserver') == 'add') { | ||
# $_POST['dns_nameservers__ip'] = ip2long($_POST['dns_nameservers__ip']); | ||
#} | ||
$f['node_id'] = intval(get('node')); | ||
$ret = TRUE; | ||
$ret = $form_nodesettingschanges->db_set(array(), | ||
"nodesettingschanges", "entryid", $nodesettingschanges); | ||
#$ret = $form_nameserver->db_set($f, | ||
# "dns_nameservers", "id", $nameserver); | ||
|
||
if ($ret) { | ||
$main->message->set_fromlang('info', 'insert_success', make_ref('/node_editor', array("node" => $_POST['nodes_nodesetttingschanges__node_id']))); | ||
#log_admin_action($nodes,"#nodesetttingschange#".get('node'),get('entryid'), "nodesetttingschanges", "insert_success");#@# | ||
} else { | ||
$main->message->set_fromlang('error', 'generic'); | ||
} | ||
} | ||
|
||
} | ||
|
||
?> |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,86 @@ | ||
<?php | ||
/* | ||
* WiND - Wireless Nodes Database | ||
* | ||
* Copyright (C) 2012 Leonidas Papadopoulos <[email protected]> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. also replace this copyright |
||
* | ||
* This program is free software; you can redistribute it and/or modify | ||
* it under the terms of the GNU General Public License as published by | ||
* the Free Software Foundation; version 2 dated June, 1991. | ||
* | ||
* 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, write to the Free Software | ||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA | ||
* | ||
*/ | ||
|
||
#if (get('log') != '') include_once(ROOT_PATH."includes/pages/admin/admin_nodechangeslog_log.php"); | ||
|
||
class nodechangeslog { | ||
|
||
var $tpl; | ||
var $page; | ||
|
||
function admin_nodechangeslog() { | ||
if (get('log') != '') { | ||
$p = "nodechangeslog_log"; | ||
$this->page = new $p; | ||
} | ||
} | ||
|
||
function table_nodechangeslog() { | ||
global $construct, $db, $main; | ||
$table_nodechangeslog = new table(array('FORM_NAME' => 'table_nodechangeslog', 'TABLE_NAME' => 'table_nodechangeslog')); | ||
$table_nodechangeslog->db_data( | ||
'nodesettingschanges.dateline, nodes.name, nodesettingschanges.changemenu, nodesettingschanges.changemade, users.username, nodesettingschanges.comment', | ||
'nodesettingschanges INNER JOIN `users` ON `users`.`id` = `nodesettingschanges`.`uid` INNER JOIN `nodes` ON `nodes`.`id` = `nodesettingschanges`.`nodeid` ', | ||
"", | ||
"", | ||
"nodesettingschanges.entryid DESC"); | ||
for($i=1;$i<count($table_nodechangeslog->data);$i++) { | ||
if (isset($table_nodechangeslog->data[$i])) { | ||
#$table_nodechangeslog->data[$i]['ip_start'] = long2ip($table_nodechangeslog->data[$i]['ip_start']); | ||
#$table_nodechangeslog->data[$i]['ip_end'] = long2ip($table_nodechangeslog->data[$i]['ip_end']); | ||
#$table_nodechangeslog->info['EDIT'][$i] = makelink(array("page" => "admin", "subpage" => "nodechangeslog", "area" => $table_nodechangeslog->data[$i]['id'])); | ||
} | ||
} | ||
#$table_nodechangeslog->info['EDIT_COLUMN'] = 'nodechangeslog__name'; | ||
$table_nodechangeslog->db_data_multichoice('dateline'); | ||
$table_nodechangeslog->info['MULTICHOICE_LABEL'] = ''; | ||
#$table_nodechangeslog->db_data_remove('id', 'uid'); | ||
return $table_nodechangeslog; | ||
} | ||
|
||
function output() { | ||
if (get('log') != '') { | ||
return $this->page->output(); | ||
} else { | ||
if ($_SERVER['REQUEST_METHOD'] == 'POST' && method_exists($this, 'output_onpost_'.$_POST['form_name'])) return call_user_func(array($this, 'output_onpost_'.$_POST['form_name'])); | ||
global $construct; | ||
#$this->tpl['link_area_add'] = makelink(array('page' => 'admin', 'subpage' => 'nodechangeslog', 'area' => 'add')); | ||
$this->tpl['table_nodechangeslog'] = $construct->table($this->table_nodechangeslog(), __FILE__); | ||
return template($this->tpl, __FILE__); | ||
} | ||
} | ||
|
||
function output_onpost_table_nodechangeslog() { | ||
global $db, $main; | ||
$ret = TRUE; | ||
foreach( (array) $_POST['id'] as $key => $value) { | ||
$ret = $ret && $db->del("nodechangeslog", "id = '".$value."'"); | ||
} | ||
if ($ret) { | ||
#$main->message->set_fromlang('info', 'delete_success', makelink("",TRUE)); | ||
} else { | ||
$main->message->set_fromlang('error', 'generic'); | ||
} | ||
} | ||
|
||
} | ||
|
||
?> |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -295,3 +295,18 @@ CREATE TABLE IF NOT EXISTS `users_nodes` ( | |
UNIQUE KEY `unique_keys` (`node_id`,`user_id`), | ||
KEY `user_id` (`user_id`) | ||
) ENGINE=MyISAM DEFAULT CHARSET=utf8; | ||
|
||
CREATE TABLE IF NOT EXISTS `nodesettingschanges` ( | ||
`entryid` int(10) NOT NULL AUTO_INCREMENT, | ||
`nodeid` int(10) NOT NULL DEFAULT '0', | ||
`uid` int(10) NOT NULL, | ||
`dateline` varchar(30) DEFAULT NULL, | ||
`changemade` text NOT NULL, | ||
`changemenu` enum('routerOS version upgrade/downgrade','groups','users','other','script','ip firewall other','ip firewall nat','ip firewall filter','wireless','snmp','radius','partitions','ipv6','ppp','INTERFACE','driver','led','user','system','special-login','routing','queue','port','mpls','log','ip','file','HARDWARE','certificate') NOT NULL, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This list should not be enum. This is something that can change often and should be easy configurable. This looks more like an application level predefined values. |
||
`reason` enum('other','bug fix','critical-problem','imporovement','termination') NOT NULL, | ||
`comment` text, | ||
PRIMARY KEY (`entryid`,`nodeid`), | ||
KEY `uid` (`uid`), | ||
KEY `changemenu` (`changemenu`), | ||
FULLTEXT KEY `changemade` (`changemade`) | ||
) ENGINE=MyISAM DEFAULT CHARSET=utf8; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
{* | ||
* WiND - Wireless Nodes Database | ||
* Basic HTML Template | ||
* | ||
* Copyright (C) 2005 Konstantinos Papadimitriou <[email protected]> | ||
* | ||
* This program is free software; you can redistribute it and/or modify | ||
* it under the terms of the GNU General Public License as published by | ||
* the Free Software Foundation; version 2 dated June, 1991. | ||
* | ||
* 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, write to the Free Software | ||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA | ||
* | ||
*} | ||
|
||
{include assign=help file=generic/help.tpl help="node_editor_nodesettingschanges_`$nodesettingschanges_method`"} | ||
{assign var=t value="nodesettingschanges_`$nodesettingschanges_method`"} | ||
{include file=generic/page-title.tpl title="`$lang.$t`" right="$help"} | ||
{$form_nodesettingschanges} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We have stopped using per-user Copyrights.
You should put your name in AUTHORS.txt and for each new file that you make you should add