File: extplorer.htusers.php

package info (click to toggle)
dtc 0.35.5-1
  • links: PTS, VCS
  • area: main
  • in suites: experimental
  • size: 18,824 kB
  • sloc: php: 50,739; sh: 8,596; makefile: 572; perl: 148; xml: 25
file content (27 lines) | stat: -rw-r--r-- 889 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
<?php 

function dtc_db_auth() {
	if( !file_exists("/usr/share/dtc/shared/mysql_config.php") ){
		return false;
	}
	require_once("/usr/share/dtc/shared/mysql_config.php");

	$ressource_id = mysql_connect("$conf_mysql_host", "$conf_mysql_login", "$conf_mysql_pass");
	if($ressource_id == false){
		return false;
	}
	mysql_select_db($conf_mysql_db)or die("Could not connect to the DTC db!");
	$q = "SELECT * FROM admin";
	$r = mysql_query($q)or die("Could not query the DTC db!");
	$n = mysql_num_rows($r);
	for($i=0;$i<$n;$i++){
		$a = mysql_fetch_array($r);
		$GLOBALS["users"][] = array($a["adm_login"],md5($a["adm_pass"]),$a["path"],"http://localhost",1,"",1,1);
	}
}

	/** ensure this file is being included by a parent file */
	defined( "_VALID_MOS" ) or die( "Direct Access to this location is not allowed." );
	$GLOBALS["users"]=array(); 
	dtc_db_auth();
?>