- add repository for module - improve version number - add check to remove module - can not upload module with the same version number - add version compare from portage (gentoo) - add release in context of eval - add active = True to base module - add wizard to update all installed modules - add check to not upload module that is not installed - add posibility to include source - fix license - now load zip module in preference bzr revid: ced-cd441fca164f32bf2a1243a4ebf8c6afdf240cdf
39 lines
1.0 KiB
PHP
39 lines
1.0 KiB
PHP
<?
|
|
function debug($str)
|
|
{
|
|
$fp = fopen('/tmp/debug_tinyerp.txt', 'a');
|
|
fwrite($fp, $str."\n");
|
|
fclose($fp);
|
|
}
|
|
|
|
$port=mysql_connect(":/var/run/mysqld/mysqld.sock","tiny","XXXX");
|
|
// Verify user and password
|
|
$query = mysql_db_query("tiny_terp", "select id,password from jos_users where username='".addslashes($_POST['login'])."' and password=md5('".addslashes($_POST['password'])."')");
|
|
$user = mysql_fetch_object($query);
|
|
if (!$user) {
|
|
echo "1\n";
|
|
return;
|
|
}
|
|
|
|
// Verify module owner
|
|
$query = mysql_db_query("tiny_terp", "select user_id from jos_mt_links where cust_7='".addslashes($_POST['module_name'])."'");
|
|
$row = mysql_fetch_object($query);
|
|
|
|
if ((!$row) or $row[0]==$user[0]) {
|
|
// save .zip module
|
|
$dest = '/home/tiny/www/tinyerp.com/download/modules/'.$_FILES['module']['name'];
|
|
if (!file_exists($dest)) {
|
|
if(move_uploaded_file($_FILES['module']['tmp_name'], $dest)) {
|
|
echo "0\n";
|
|
return;
|
|
} else{
|
|
echo "3\n";
|
|
return;
|
|
}
|
|
} else {
|
|
echo "2\n";
|
|
return;
|
|
}
|
|
}
|
|
?>
|