$HOST_TYPE["cisco"]["configform"] = "somefuntion";
$HOST_TYPE["cisco"]["postfunction"] = "somefuntion";
+function cisco_getConfig($istest)
+{
+ genericssh_ssh($host, $username, $password, "show running");
+}
?>
\ No newline at end of file
{
global $DB_URL;
+ if(!isset($IS_WEB_REQUEST)) {
+ // only the web requests are allowed to create dbs
+ return false;
+ }
+
+
$dbobject = false;
global $BASE_DIR, $DB_HANDLE;
if($DB_HANDLE != false) return $DB_HANDLE;
{
$db = db_getDB();
+ if(!$db) return false;
+
if(db_tableExists($tablename)) return true;
$sql = "create table \"$tablename\" (\"".$tablename."_id\" INTEGER PRIMARY KEY AUTOINCREMENT";
$db = db_getDB();
+ if(!$db) return false;
+
$sql = "insert into \"$tablename\" values (NULL";
for($i=1; $i < func_num_args(); $i++) {
$sql .= ",'".func_get_arg($i)."'";
{
$db = db_getDB();
+ if(!$db) return false;
+
if($column != "") $extra = " where $column like '%$value%'";
else $extra = "";
$sql = "select * from \"$tablename\"$extra";
{
$db = db_getDB();
+ if(!$db) return false;
+
$sql = "delete from \"$tablename\" where $column like '%$value%'";
//echo "Sql is $sql\n";
return $db->query($sql);
{
$db = db_getDB();
+ if(!$db) return false;
+
if($exact) $sql = "update \"$tablename\" set $column='$newdata' where $wherecol='$wheredata'";
else $sql = "update \"$tablename\" set $column='$newdata' where $wherecol like '$wheredata'";
return $db->query($sql);
{
$db = db_getDB();
+ if(!$db) return false;
+
$sql = "drop table $tablename";
return $db->query($sql);
{
$db = db_getDB();
+ if(!$db) return false;
+
$sql = "select count(*) from sqlite_master where type='table' and name='$tablename'";
$res = $db->query($sql);
{
$db = db_getDB();
+ if(!$db) return false;
+
$sql = "select name from sqlite_master where type='table' and name not like 'sqlite_%'";
$res = $db->query($sql);
--- /dev/null
+<?php
+
+function genericssh_ssh($host, $username, $password, $command)
+{
+ $connector = ssh2_connect("$host");
+ ssh2_auth_password($connector, "$username", "$password");
+ $stream = ssh2_exec($connector, "$command");
+ stream_set_blocking($stream, true);
+
+ $config = stream_get_contents($stream);
+
+ return $config;
+}
+
+?>
\ No newline at end of file
echo "No plugins dir ($basedir/plugins), continuing without\n";
}
-$db = db_getDB();
?>
\ No newline at end of file
function nsos_getConfig($istest)
{
-
+ genericssh_ssh($host, $username, $password, "cli show configuration");
}
?>
\ No newline at end of file
<?php
+
// some global menu stuff
$MENUS["home"]["url"] = "?action=home";
$MENUS["home"]["name"] = "Home";
<?php
require_once("../lib/lib.php");
+$IS_WEB_REQUEST=true;
+global $IS_WEB_REQUEST;
+
if(isset($_REQUEST["xmlrpc"])) {
rpc_handler();
return;