<?php require "c:/xampp/security/pixelp/_connector.php"; require "include/init.php"; require "classes/db.php"; require "classes/pixelp.php"; $db = new DATABASE(); $db->connect(DB_HOST, DB_NAME, DB_USER, DB_PASS, DB_CHARSET, DB_COLLATION); $import = new PIXELP_IMPORT($db); //$import->add_queue(); $import->process_queue();
// AD objekt $ad->debug = $w->debug; if (!$ad->connect()) { $t->errors[ERROR][] = 'L002 ' . $l->txt_err_ldap_connect; } if (!$ad->bind($p->uname, $p->secret)) { // create a syslog entry syslog(LOG_NOTICE, sprintf("AD bind failed. user: %s remote_addr: %s method: %s token: %s", $p->uname, $w->remote_addr, $auth_method, $o->token)); // AD bind failis. Nüüd proovime lokaalse kasutajaga. require INC_DIR . '/local.php'; if ($w->allow_local) { if (!isset($d)) { $d = new DATABASE(); // lokaalsed kasutajad paiknevad DB's. Siiani pole DB'd vaja läinud. $d->debug = $w->debug; if (!$d->connect(DB_HOST, DB_USER, DB_PASS, DATABASE)) { $t->errors[ERROR][] = 'C001.1 ' . $l->txt_err_open_database; } } // print_r($d); if (local_login($d, $p->uname, $p->secret, $u)) { $auth_method = 'local'; $authok = true; } else { // create a syslog entry syslog(LOG_NOTICE, sprintf("User not found. user: %s remote_addr: %s method: %s token: %s", $p->uname, $w->remote_addr, $auth_method, $o->token)); $t->errors[ERROR][] = 'L003 ' . $l->txt_err_authentication; } } else { $t->errors[ERROR][] = 'L003.9 ' . $l->txt_err_authentication; }
<?php // imap postkasti sisu hankimine if (isset($v->post->ptable["data"]["imap"])) { require PLUGIN_PATH . "/srm/inc/lib/class_email.php"; $d = new DATABASE(); if (!$d->connect(DB_HOST, DB_USER, DB_PASS, PLUGIN_SRM)) { $w->alert[ERROR][] = "C001 " . $l->txt_err_open_database; return false; } $email = new EMAIL($d, $v->post->ptable["data"]["imap"]); $email->fetch(); $detect = ["Tellimus / Order: #", "Tellimus: #", "Order: #", "Ylesanne: #"]; $data_array = []; foreach ($email->c as $msg) { $found_reply = false; foreach ($detect as $detected) { if (strpos($msg->subject, $detected) !== false) { $found_reply = true; break; } } if ($found_reply || $msg->answered == 'A' || !isset($msg->body) || !isset($msg->size)) { continue; } $data_array[] = $msg; } } // põhiklassi extension, võimaldamaks päringust saadud väärtusi edasi töödelda class PTABLE_EXT extends PTABLE {