function login($_POST)
{
    global $_SESSION;
    extract($_POST);
    require_lib("validate");
    $v = new validate();
    $v->isOk($code, "string", 1, 5, "Invalid company name.");
    # Display errors, if any
    if ($v->isError()) {
        $confirm = "";
        $errors = $v->getErrors();
        foreach ($errors as $e) {
            $confirm .= "<li class='err'>" . $e["msg"] . "</li>";
        }
        return slctcomp($confirm);
    }
    # Change code to lowercase
    $code = strtolower($code);
    if (!db_check("cubit_" . $code)) {
        return slctcomp("<li class='err'>Invalid Company. Select another company or<br />\n\t\t\tclick <a href='company-new.php?key=recover'>here</a> to see if Cubit can recover from this error.</li>");
    }
    # Get Company Name
    db_conn("cubit");
    $sql = "SELECT name FROM companies WHERE code = '{$code}'";
    $compRslt = db_exec($sql) or errDie("Unable to access database.", SELF);
    if (pg_numrows($compRslt) < 1) {
        $comp['name'] = "";
    } else {
        $comp = pg_fetch_array($compRslt);
    }
    $_SESSION["code"] = $code;
    $_SESSION["comp"] = $comp['name'];
    header("Location: doc-index.php");
}
Example #2
0
	}
	</style>
</head>
<body>



<div id='over'>
<div id='top_bar'>
OptivumToSQL
</div>

<?php 
require_once "config.php";
require_once "bin/class.php";
$con = db_check();
if ($con == false) {
    echo '<span class="red">Błąd połączenia z bazą danych.<br/> Dokonaj poprawy w pliku <u>config.php</u></span>';
    exit;
}
table_check($con);
if (isset($_POST['parse'])) {
    if (!filter_var($_POST['parse'], FILTER_VALIDATE_URL)) {
        echo "<span class='red'>Błędny URL.</span><br/> Poprawny format: <u>http://serwer/plan/</u> / <u>http://serwer/plan/index.html</u><br/><a href='index.php'>Powrót</a><br/><br/><br/>";
    }
    if ($_POST['pass'] == $pass) {
        exportToMySQL(parseToSql($_POST['parse']), $con);
    } else {
        echo "<span class='red'>Błąd autoryzacji.</span><br/><a href='index.php'>Powrót</a>";
    }
} else {
Example #3
0
    <style media="screen" type="text/css">@import url(style/setup.css);</style>
</head>
<body>

<h1 id="header">phpMyFAQ <?php 
print VERSION;
?>
 Setup</h1>

<?php 
if (version_compare(PHP_VERSION, '5.2.0', '<')) {
    print "<p class=\"center\">You need PHP 5.2.0 or later!</p>\n";
    HTMLFooter();
    die;
}
if (!db_check($supported_databases)) {
    print '<p class="center">No supported database detected! Please install one of the following' . ' database systems and enable the corresponding PHP extension:</p>';
    print '<ul>';
    foreach ($supported_databases as $database) {
        printf('    <li>%s</li>', $database[1]);
    }
    print '</ul>';
    HTMLFooter();
    die;
}
$missing = array();
if (!extension_check($enabled_extensions, $missing)) {
    print "<p class=\"center\">The following extensions are missing! Please enable the PHP extension:</p>\n";
    print "<ul>\n";
    foreach ($missing as $extension) {
        printf('    <li>ext/%s</li>', $extension);
Example #4
0
    echo "Your PHP installation appears to be missing the gettext extension which is required by Emoncms. <br> See /php-info.php (restricted to local access)";
    die;
}
$mysqli = @new mysqli($server, $username, $password, $database, $port);
if ($mysqli->connect_error) {
    echo "Can't connect to database, please verify credentials/configuration in settings.php<br />";
    if ($display_errors) {
        echo "Error message: <b>" . $mysqli->connect_error . "</b>";
    }
    die;
}
// Set charset to utf8
$mysqli->set_charset("utf8");
if (!$mysqli->connect_error && $dbtest == true) {
    require "Lib/dbschemasetup.php";
    if (!db_check($mysqli, $database)) {
        db_schema_setup($mysqli, load_db_schema(), true);
    }
}
// 3) User sessions
require "Modules/user/user_model.php";
$user = new User($mysqli, $redis);
$apikey = false;
$devicekey = false;
if (isset($_GET['apikey'])) {
    $apikey = $_GET['apikey'];
} else {
    if (isset($_POST['apikey'])) {
        $apikey = $_POST['apikey'];
    } else {
        if (isset($_GET['devicekey'])) {
Example #5
0
print VERSION;
?>
 Installation</h1>

<?php 
if (version_compare(PHP_VERSION, '4.1.0') < 0) {
    print "<p class=\"center\">You need PHP Version 4.1.0 or higher!</p>\n";
    HTMLFooter();
    die;
}
if (!extension_loaded('gd')) {
    print '<p class="center">You don\'t have GD support enabled in your PHP installation. Please enabled GD support in your php.ini file.</p>';
    HTMLFooter();
    die;
}
if (db_check($supported_databases) == false) {
    print "<p class=\"center\">No supported database found! Please install one of the following database systems and enable the m \tcorresponding PHP extension:</p>\n";
    print "<ul>\n";
    foreach ($supported_databases as $database) {
        printf('    <li>%s</li>', $database[1]);
    }
    print "</ul>\n";
    HTMLFooter();
    die;
}
if (!phpmyfaq_check()) {
    print '<p class="center">It seems you already running a version of phpMyFAQ.<br />Please use the <a href="update.php">update script</a>.</p>';
    HTMLFooter();
    die;
}
$dirs = array('/attachments', '/data', '/images', '/inc', '/pdf', '/xml');
Example #6
0
    foreach ($prioritized as $dir => $priority) {
        if (!in_array($dir, $installed)) {
            db_delete(TBL_PREFIX . TBL_EXTS, "dir = '" . $dir . "'");
        }
    }
}
// display header title
echo '<h1>Admin panel</h1>';
/* now check for new releases
    servers in safe_mode or with open_basedir set will throw a CURL_FOLLOW_LOCATION error
*/
echo check_smt_releases();
/* connection settings ------------------------------------------------------ */
error_reporting(0);
// check if (smt) is installed properly
if (!db_check()) {
    $dberror = true;
    $msg = '<h2>Seems that you need to setup your database</h2>';
    $msg .= '<p>';
    $msg .= 'Did you edit your <em>config.php</em> file?' . PHP_EOL;
    $msg .= 'If server data are correct, go <a href="' . SYS_DIR . 'install.php">install (smt)</a>.';
    $msg .= '</p>';
    echo display_text($_displayType["WARNING"], $msg, 'div');
}
// now enable default error reporting
error_reporting(E_ALL ^ E_NOTICE);
/* JSON checking ------------------------------------------------------------ */
if (!function_exists('json_encode')) {
    $msg = '<h2>JSON library not found</h2>';
    $msg .= '<p>';
    $msg .= 'Your server does not have the JavaScript Object Notation extension installed.' . PHP_EOL;
Example #7
0
    array_pop($svnStatus);
    sort($svnStatus);
    $db = 0;
    echo "Liste des fichiers concern&eacute;s par la mise &agrave; jour :<br/>";
    echo "<pre>";
    foreach ($svnStatus as $file) {
        //echo str_replace("$dossierInstall/","",$file)."\n";
        $line = str_replace("{$dossierInstall}/", "", $file);
        preg_match('/(.{7})(.{7})(.{6})(.*)/', $line, $lineDetail);
        list(, $local, $remote, $rev, $file) = $lineDetail;
        echo "<form method='post' action='' ><input type='hidden' name='MD5' value='{$md5}'/>";
        echo "  " . preg_replace('/ +/', "  ", $local) . preg_replace('/ +/', "  ", $remote) . preg_replace('/ +/', "  ", $rev);
        echo "<input type='hidden' name='detailSVN' value='{$file}'/>{$file}&nbsp;<input type='submit' value='Voir'/></form>";
    }
    echo "</pre>";
    if (db_check($svnStatus)) {
        echo "La mise &agrave; jour n&eacute;cessite une mise &agrave; jour de la base de donn&eacute;e.<br/>";
    }
    echo "<form method='POST' action=''>\n        <input type='hidden' name='MD5' value='{$md5}'/>\n        <input type='hidden' name='do'  value='1'/>\n        <input type='submit' value='Effectuer la mise &agrave; jour'/>\n        </form>";
} else {
    echo "Votre installation est &agrave; jour (REV #{$WC_REV})";
}
/**
 ** Voir la diffrence
 **/
if (isset($_POST['detailSVN'])) {
    exec("{$svnCmd} --username={$loginSVN} --password={$passwordSVN} diff {$dossierInstall}/" . $_POST['detailSVN'], $svnDiff, $error);
    echo "<div style='border: 1px solid gray;'>";
    echo "<pre>";
    foreach ($svnDiff as $diff) {
        echo "{$diff}\n";
/**
 * agi_credit - add or remove an amount of money from an account
 *
 */
function agi_credit($account, $modification)
{
    global $db;
    agi_log(DEBUG_INFO, "agi_credit({$account}, {$modification})");
    $query = "update People_PrePay_Settings " . "set credit = credit + ({$modification}) " . "where People_Extension = {$account} ";
    $db->query($query);
    db_check($db);
}