Ejemplo n.º 1
0
        // avoid errors in ADONewConnection() (wrong darabase driver etc...)
        if ($dbcon = initTikiDB($api_tiki, $db_tiki, $host_tiki, $user_tiki, $pass_tiki, $dbs_tiki, $client_charset, $dbTiki)) {
            $smarty->assign('resetdb', isset($_REQUEST['reset']) ? 'y' : 'n');
            $installer = new Installer();
            $installer->setServerType($db_tiki);
            if (!$client_charset_forced) {
                write_local_php($db_tiki, $host_tiki, $user_tiki, $pass_tiki, $dbs_tiki, $client_charset, $api_tiki_forced ? $api_tiki : '', $dbversion_tiki);
            }
        }
    }
} elseif ($dbcon) {
    $installer = new Installer();
    TikiDb::get()->setErrorHandler(new InstallerDatabaseErrorHandler());
}
if ($dbcon) {
    $admin_acc = has_admin($api_tiki);
}
if ($admin_acc == 'n') {
    $smarty->assign('noadmin', 'y');
} else {
    $smarty->assign('noadmin', 'n');
}
// We won't update database info unless we can't connect to the database.
// We won't reset the db connection if there is an admin account set
// and the admin is not logged
if ((!$dbcon || isset($_REQUEST['resetdb']) && $_REQUEST['resetdb'] == 'y' && ($admin_acc == 'n' || isset($_SESSION["install-logged-{$multi}"]) && $_SESSION["install-logged-{$multi}"] == 'y')) && isset($_REQUEST['dbinfo'])) {
    if (!empty($_REQUEST['name'])) {
        if (isset($_REQUEST['force_utf8'])) {
            $client_charset = 'utf8';
        } else {
            $client_charset = '';
Ejemplo n.º 2
0
    $dbcon = false;
    $smarty->assign('resetdb', 'n');
    if (isset($dbservers[$db_tiki])) {
        // avoid errors in ADONewConnection() (wrong darabase driver etc...)
        if ($dbcon = initTikiDB($api_tiki, $db_tiki, $host_tiki, $user_tiki, $pass_tiki, $dbs_tiki, $client_charset, $dbTiki)) {
            $smarty->assign('resetdb', isset($_REQUEST['reset']) ? 'y' : 'n');
            $installer = new Installer();
            $installer->setServerType($db_tiki);
            if (!$client_charset_forced) {
                write_local_php($db_tiki, $host_tiki, $user_tiki, $pass_tiki, $dbs_tiki, $client_charset, $api_tiki_forced ? $api_tiki : '', $dbversion_tiki);
            }
        }
    }
}
if ($dbcon) {
    $admin_acc = has_admin($dbTiki, $api_tiki);
}
if ($admin_acc == 'n') {
    $smarty->assign('noadmin', 'y');
} else {
    $smarty->assign('noadmin', 'n');
}
// We won't update database info unless we can't connect to the database.
// We won't reset the db connection if there is an admin account set
// and the admin is not logged
if ((!$dbcon || isset($_REQUEST['resetdb']) && $_REQUEST['resetdb'] == 'y' && ($admin_acc == 'n' || isset($_SESSION["install-logged-{$multi}"]) && $_SESSION["install-logged-{$multi}"] == 'y')) && isset($_REQUEST['dbinfo'])) {
    if (!empty($_REQUEST['name'])) {
        if (isset($_REQUEST['force_utf8'])) {
            $client_charset = 'utf8';
        } else {
            $client_charset = '';
Ejemplo n.º 3
0
?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Haitian Quake Person Database</title>
<link rel="stylesheet" href="/style.css" type="text/css" />
<?php 
include 'header.php';
?>
<h2>Haitian Quake Admin</h2></div>
<div style="clear:both"></div>
	<div id="content">
		<?php 
if (has_admin()) {
    ?>
			You are logged in as admin. <a href="/admin.php?logout=true">Click Here</a> to log out.
		<?php 
} else {
    ?>
			<form method="post">
				<table>
					<tr>
						<td colspan="2"><h3>Login to manage HaitianQuake.com</h3></td>
					</tr>
					<tr>
						<td><label for="name">Name</label></td>
						<td><input type="text" id="name" name="name" value="" /></td>
					</tr>
					<tr>
Ejemplo n.º 4
0
        ?>
' onClick = 'toss();'  STYLE = 'display:<?php 
        echo $display_val;
        ?>
;' />
<?php 
    } else {
        ?>
		<INPUT ID='clear_btn' TYPE= 'button' CLASS='btn_not_chkd' VALUE='Clear' onClick = "set_assign('c');"   STYLE = 'display:<?php 
        echo $display_val;
        ?>
;' />	
<?php 
    }
    // end if (is_date($time_clear))
    if (is_unit() || has_admin() && intval($unit_id) > 0) {
        // do/do-not allow status change - 2/7/12
        $query = "SELECT * FROM `{$GLOBALS['mysql_prefix']}responder` `u` \n\t\t\tWHERE `u`.`id` = {$unit_id} LIMIT 1";
        $result = mysql_query($query) or do_error($query, 'mysql query failed', mysql_error(), basename(__FILE__), __LINE__);
        $temp_row = mysql_fetch_assoc($result);
        ?>
		<DIV CLASS='sel' style='width: 152px; display:<?php 
        echo $display_val;
        ?>
;'><?php 
        print get_text("Status");
        ?>
:<BR /><?php 
        print get_status_sel($unit_id, $temp_row['un_status_id'], "u", 10);
        ?>
</DIV>
function list_users()
{
    /* list users */
    global $colors;
    // 9/3/10
    //	$result = mysql_query("SELECT * FROM `$GLOBALS[mysql_prefix]user`") or do_error('list_users()::mysql_query()', 'mysql query failed', mysql_error(), __FILE__, __LINE__);
    $query = "SELECT *,\n\t\t`u`.`id` AS `userid`,\n\t\t`r`.`name` AS `unitname`,\n\t\t`r`.`id` AS `unitid`\n\t\tFROM `{$GLOBALS['mysql_prefix']}user` `u`\n\t\tLEFT JOIN `{$GLOBALS['mysql_prefix']}responder`\t `r` ON (`u`.`responder_id` = `r`.`id`)\n\t\tWHERE `passwd` <> '55606758fdb765ed015f0612112a6ca7'\t\n\t\tORDER BY `u`.`user` ASC ";
    // 5/25/09, 1/16/08
    $result = mysql_query($query) or do_error($query, 'mysql query failed', mysql_error(), basename(__FILE__), __LINE__);
    if (mysql_affected_rows() == 0) {
        print '<B>[no users found]</B><BR />';
        return;
    }
    //	if (!check_for_rows("SELECT id FROM `$GLOBALS[mysql_prefix]user`")==0) { print '<B>[no users found]</B><BR />'; return; 	}
    $now = mysql_format_date(time() - get_variable('delta_mins') * 60);
    // 1/23/10
    print "<TABLE BORDER='0' CELLPADDING=2>";
    $caption = has_admin() ? " - click to edit" : "";
    //
    print "<TR CLASS='even'><TD COLSPAN='99' ALIGN='center'><B>Users" . $caption . " </B></TD></TR>";
    print "<TR CLASS='odd'><TD><B>ID</B></TD>\n\t\t<TD><B>&nbsp;User</B></TD>\n\t\t<TD><B>&nbsp;Online</B></TD>\n\t\t<TD><B>&nbsp;Level</B></TD>\n\t\t<TD><B>&nbsp;Unit</B></TD>\n\t\t<TD><B>&nbsp;Call</B></TD>\n\t\t<TD><B>&nbsp;Description</B></TD>\n\t\t<TD><B>&nbsp;Log in</B></TD>\n\t\t<TD><B>&nbsp;From</B></TD>\n\t\t<TD><B>&nbsp;Browser</B></TD>\n\t\t</TR>";
    $i = 1;
    while ($row = stripslashes_deep(mysql_fetch_array($result))) {
        // 10/8/08
        $onclick = has_admin() ? " onClick = \"self.location.href = 'config.php?func=user&id={$row['userid']}' \"" : "";
        $level = get_level_text($row['level']);
        $login = format_date_time($row['login']);
        $online = $row['expires'] > $now ? "<IMG SRC = './markers/checked.png' BORDER=0>" : "";
        print "<TR CLASS='{$colors[$i % 2]}' {$onclick}>\n\t\t\t\t<TD>{$row['userid']}</TD>\n\t\t\t\t<TD>&nbsp;{$row['user']}</TD>\n\t\t\t\t<TD ALIGN = 'center'>{$online}</TD>\n\t\t\t\t<TD>{$level}</TD>\n\t\t\t\t<TD>{$row['unitname']}</TD> \n\t\t\t\t<TD>{$row['callsign']}</TD>\n\t\t\t\t<TD>{$row['info']}</TD>\n\t\t\t\t<TD>{$login}</TD>\n\t\t\t\t<TD>{$row['_from']}</TD>\n\t\t\t\t<TD>{$row['browser']}</TD>\n\t\t\t\t</TR>\n";
        $i++;
    }
    print '</TABLE><BR />';
}
Ejemplo n.º 6
0
echo get_variable('def_zoom') - 4;
?>
);
		map.addControl(new GLargeMapControl3D()); 									// Zoom control
		map.addMapType(G_PHYSICAL_MAP);
		var hierarchy = new GHierarchicalMapTypeControl(); 							// Create a hierarchical map type control
		hierarchy.addRelationship(G_SATELLITE_MAP, G_HYBRID_MAP, "Labels", true);	// make Hybrid the Satellite default
		map.addControl(hierarchy);													// add the control to the map
		map.addControl(new GScaleControl());										// Scale bar
//		map.disableDoubleClickZoom();
//		GEvent.addListener(map, "click", leftClick);								// Add click event listener
	
		}				// end function buildMap_l()

<?php 
$func = has_admin() ? "u" : "r";
?>
function to_p(the_id) {		// poly
	document.navform.id.value = the_id;
	document.navform._func.value = "<?php 
echo $func;
?>
";
	document.navform.action = "<?php 
echo basename(__FILE__);
?>
";
	document.navform.submit();

	}
function to_c(the_id) {		// circle
Ejemplo n.º 7
0
        } else {
            $dbcon = true;
            if (!isset($_REQUEST['reset'])) {
                $smarty->assign('dbcon', 'y');
                $smarty->assign('resetdb', 'n');
            } else {
                $smarty->assign('dbcon', 'y');
                $smarty->assign('resetdb', 'y');
            }
        }
    }
}
// next lines checks if there is a admin account in the db
$admin_acc = 'n';
if ($dbcon) {
    has_admin();
}
if ($admin_acc == 'n') {
    $smarty->assign('noadmin', 'y');
} else {
    $smarty->assign('noadmin', 'n');
}
// We won't update database info unless we can't connect to the
// database.
// we won't reset the db connection if there is a admin account set
// and the admin is not logged
//debugging:
/*
if ($dbcon) echo "dbcon true <br>";
if ($_REQUEST['resetdb']=='y') echo '$_REQUEST[resetdb]==y<br>';
if (isset($_REQUEST['dbinfo'])) echo '$_REQUEST[dbinfo] is set<br>';
Ejemplo n.º 8
0
?>
), <?php 
echo get_variable('def_zoom') - 4;
?>
);
		map.addControl(new GLargeMapControl3D()); 									// Zoom control
		map.addMapType(G_PHYSICAL_MAP);
		var hierarchy = new GHierarchicalMapTypeControl(); 							// Create a hierarchical map type control
		hierarchy.addRelationship(G_SATELLITE_MAP, G_HYBRID_MAP, "Labels", true);	// make Hybrid the Satellite default
		map.addControl(hierarchy); 													// add the control to the map
		map.addControl(new GScaleControl()); 										// Scale bar
	
		}				// end function buildMap_l()

<?php 
$func = has_admin() ? "u" : "v";
?>
function to_p(the_id) {		// poly
	document.navform.id.value = the_id;
	document.navform._func.value = "<?php 
echo $func;
?>
";
	document.navform.action = "<?php 
echo basename(__FILE__);
?>
";
	document.navform.submit();

	}
function to_c(the_id, the_func) {		// circle