[wpkg_web] / connect.php Repository:
ViewVC logotype

View of /connect.php

Parent Directory Parent Directory | Revision Log Revision Log


Revision 46 - (download) (annotate)
Thu Feb 1 16:17:44 2007 UTC (11 years, 5 months ago) by linuxkidd
File size: 926 byte(s)
Added HTTP Auth user checking for WPKG.js XML pulls.  Please get the latest version of wpkg to take advantage of direct Web pulls!
Changed XML to export "execute='always'" as default for packages with no checks, and no 'execute='once'" set.
Changed (X) Delete icon in packages_list.php to only appear when the package is marked obsolete, or is not in any profiles.
Fixed bug which resulted in MAC addresses which were all numeric being truncated.

<?php

if (!file_exists("config.php")) {
  print 
"Please copy the config-dist.php file to config.php and edit to suit your site.<br />";
  exit;
}
include 
"config.php";

if(isset(
$_SERVER['PHP_AUTH_USER']) && isset($wpkg_user) && $_SERVER['PHP_AUTH_USER'] == $wpkg_user) {
  
$path_data=split("/"$_SERVER['PHP_SELF']);
  
$script=array_pop($path_data);
  if(!
preg_match('/_xml_out\.php/',$script)) {
    print 
"You are only allowed to export XML from wpkg_web.";
    exit;
  }
}

$db mysql_connect($dbhost$dbuser$dbpass) or die($vocab['errmsg-connect'] . ": " mysql_error());

if(!
$db)
  die(
$vocab['errmsg-nodb']);
if(!
mysql_select_db($dbname,$db))
  die(
$vocab['errmsg-nodb']);

include 
"upcheck.php";

function 
quote_smart($value) {
  if (
get_magic_quotes_gpc()) {
    
$value stripslashes($value);
  }
  
$value "'" mysql_real_escape_string($value) . "'";
  return 
$value;
}
?>

ViewVC Help
Powered by ViewVC 1.0.3