Пример #1
0
 public function edit()
 {
     if (getId() == '') {
         Router::redirect('/');
     }
     if ($_POST) {
         if (!isset($_POST['back'])) {
             $id = isset($_POST['id']) ? (int) $_POST['id'] : null;
             $res_post = $_POST;
             $result = $this->model->save($res_post, $id);
             if ($result) {
                 Session::setFlash(__('page_was_saved', 'Page was saved'));
             } else {
                 Session::setFlash(__('page_was_not_saved', 'Page was not saved'));
             }
         }
         Router::redirect('/pages/profileview/' . getId());
     }
     if (isset($this->params[0])) {
         $this->data['pages'] = $this->model->getById($this->params[0]);
     } else {
         Session::setFlash(__('Wrong_page_id', 'Wrong page id'));
         Router::redirect('/pages/');
     }
 }
Пример #2
0
function delete()
{
    $id = getId();
    if ($_SERVER['REQUEST_METHOD'] == 'POST') {
        mysql_query("DELETE FROM list WHERE id='{$id}'") or mysql_error();
    }
}
Пример #3
0
 public function convertStr($stringFrom)
 {
     if (preg_match("/[а-яА-Я]+/u", $stringFrom)) {
         $name = explode('.', $stringFrom);
         return getId() . '-' . time() . '.' . $name[1];
     }
     return $stringFrom;
 }
Пример #4
0
 public function funcTest()
 {
     function getId($self)
     {
         return $self->getPrivateId();
     }
     return getId($this);
 }
Пример #5
0
 function BxWallPage($sOwner, &$oWall)
 {
     $this->_sOwner = $sOwner;
     $this->_oWall =& $oWall;
     $this->oProfileGen = new BxBaseProfileGenerator(getId($sOwner, 0));
     $this->aConfSite = $GLOBALS['site'];
     $this->aConfDir = $GLOBALS['dir'];
     parent::BxDolPageView('wall');
 }
Пример #6
0
 public function getIdByNameArr($_arrName)
 {
     $retArr = [];
     foreach ($_arrName as $item) {
         $id = getId($item);
         array_push($retArr, $id);
     }
     return $retArr;
 }
Пример #7
0
 public function admin_back()
 {
     if (getId() == null) {
         Router::redirect('/');
     }
     if ($_POST['back']) {
         Router::redirect('/admin/contacts/');
     }
 }
Пример #8
0
 function __construct($sOwner, &$oWall)
 {
     $this->_sOwner = $sOwner;
     $this->_oWall =& $oWall;
     $this->oProfileGen = new BxBaseProfileGenerator(getId($sOwner, 0));
     $this->aConfSite = $GLOBALS['site'];
     $this->aConfDir = $GLOBALS['dir'];
     parent::__construct('wall');
 }
 public function getRecentProducts()
 {
     // call model to fetch data
     $arr_products = array();
     $products = Mage::getModel("orderedproducts/orderedproducts")->getOrderedProducts();
     foreach ($products as $product) {
         $arr_products[] = array('id' => $product - ­ > getId(), 'name' => $product->getName(), 'url' => $product->getProductUrl());
     }
     return $arr_products;
 }
Пример #10
0
 function getRecord($id, $useUuid = false)
 {
     $therecord = parent::getRecord($id, $useUuid);
     /**
      *   If type is credit, get the receipt id
      *   else get the invoice id
      */
     if ($therecord["type"] == "credit") {
         $therecord["editrelatedid"] = getId($this->db, "tbld:43678406-be25-909b-c715-7e2afc7db601", $therecord["relatedid"]);
     } else {
         $therecord["editrelatedid"] = getId($this->db, "tbld:62fe599d-c18f-3674-9e54-b62c2d6b1883", $therecord["relatedid"]);
     }
     return $therecord;
 }
Пример #11
0
 public function __construct($rows, $cols = null, $opts = array())
 {
     // Make sure rows are all arrays
     foreach ($rows as $k => $row) {
         if (!is_array($row)) {
             $rows[$k] = (array) $rows[$k];
         }
     }
     if (!isset($cols)) {
         $cols = array();
         if (count($rows) > 0) {
             $row = $rows[0];
             foreach ($row as $k => $v) {
                 if ($k === '__meta__') {
                     continue;
                 }
                 $cols[] = array('label' => $k, 'name' => $k);
             }
         }
     }
     $flds = array('table', 'cssClass', 'canEdit', 'canAdd', 'canDelete', 'rowActions', 'newParams', 'params', 'addButtonLabel');
     foreach ($flds as $fld) {
         if (isset($opts[$fld])) {
             $this->{$fld} = $opts[$fld];
         }
     }
     $this->cssClass .= ' xf-portlet';
     $decorateRow = null;
     if (isset($opts['decorateRow']) and is_callable($opts['decorateRow'])) {
         $decorateRow = $opts['decorateRow'];
     }
     foreach ($rows as $k => $row) {
         if (!isset($rows[$k]['__meta__'])) {
             $rows[$k]['__meta__'] = array();
         }
         $dfRec = new \Dataface_Record($this->table, array());
         if (!@$rows[$k]['__meta__']['recordId']) {
             $dfRec->setValues($row);
             $rows[$k]['__meta__']['recordId'] = $dfRec - getId();
         }
         $rows[$k]['__meta__']['record'] = $dfRec;
         if (isset($decorateRow)) {
             $decorateRow($rows[$k]);
         }
     }
     $this->cols = $cols;
     $this->rows = $rows;
     $this->opts = $opts;
 }
Пример #12
0
function display_posts($name)
{
    include 'html/showposts.php';
    $conn = connect();
    $id = getId($name);
    mysql_select_db("unihub", $conn);
    $query = "SELECT * FROM posts WHERE `id` = '{$id}'";
    $result = mysql_query($query, $conn) or die(mysql_error());
    if (mysql_num_rows($result) > 0) {
        // output data of each row
        while ($row = mysql_fetch_array($result)) {
            show_posts($row['title'], $row['thumb-desc'], $row['published'], $row['avatar'], $row['feature'], $row['main-desc'], $row['likes'], $row['comments']);
        }
    }
}
Пример #13
0
 function CreateOperator($_loginId, $_fullName, $_email, $_permissions, $_webspace, $_passwordMD5, $_administrator, $_groups, $_language)
 {
     $operator = new Operator(getId(USER_ID_LENGTH), $_loginId);
     $operator->Load();
     $operator->Fullname = $_fullName;
     $operator->Email = $_email;
     $operator->PermissionSet = $_permissions;
     $operator->Webspace = $_webspace;
     $operator->Password = $_passwordMD5;
     $operator->Level = $_administrator ? 1 : 0;
     $operator->Groups = $_groups;
     $operator->Language = $_language;
     $operator->Save(true);
     return $operator;
 }
Пример #14
0
            }
            if (!$sMessageBody) {
                $sErrorMessage = '_Mailbox description empty';
            }
            if (!$vRecipientID) {
                $sErrorMessage = '_Mailbox recipient empty';
            }
            $sOutputHtml = !$sErrorMessage ? $oMailBox->sendMessage($sMessageSubject, $sMessageBody, $vRecipientID, $aComposeSettings) : _t_err($sErrorMessage);
            break;
        case 'auto_complete':
            if ($sAutoCompleteQ) {
                $sOutputHtml = $oMailBox->getAutoCompleteList($sAutoCompleteQ);
            }
            break;
        case 'get_thumbnail':
            $iRecipientID = getId($vRecipientID);
            if ($iRecipientID) {
                $sOutputHtml = get_member_thumbnail($iRecipientID, 'none');
            }
            break;
    }
    // try to define the callback function name ;
    if (isset($_GET['callback_function']) and in_array($_GET['callback_function'], $aCallbackFunctions)) {
        if (method_exists($oMailBox, $_GET['callback_function'])) {
            $sOutputHtml = $oMailBox->{$_GET['callback_function']}();
        }
    }
    header('Content-Type: text/html; charset=utf-8');
    echo $sOutputHtml;
    exit;
}
Пример #15
0
function selectCommenti($scout_idscout)
{
    $database = connect();
    $res = $database->select("commenti", ['[>]utenti' => ['idutenti' => 'id']], ['commenti.id', 'commenti.idutenti', 'utenti.utente(username)', 'utenti.photo', 'commenti.data', 'commenti.titolo', 'commenti.testo'], ['commenti.scout_idscout[=]' => $scout_idscout]);
    $id = getId();
    foreach ($res as &$r) {
        if ($r['idutenti'] == $id) {
            $r['owner'] = True;
        } else {
            $r['owner'] = False;
        }
    }
    return $res;
}
Пример #16
0
function strip_dir($dir, $fn)
{
    global $conf;
    return end(explode($dir . '/', $fn, 2));
}
switch ($argv[1]) {
    case 'cleanID':
        echo cleanID($argv[2]);
        break;
    case 'wikiFN':
        if ($argc > 3 && $argv[3]) {
            echo strip_dir($conf['olddir'], wikiFN($argv[2], $argv[3]));
        } else {
            echo strip_dir($conf['datadir'], wikiFN($argv[2]));
        }
        break;
    case 'mediaFN':
        echo strip_dir($conf['mediadir'], mediaFN($argv[2]));
        break;
    case 'metaFN':
        echo strip_dir($conf['metadir'], metaFN($argv[2], $argv[3]));
        break;
    case 'getNS':
        echo getNS($argv[2]);
        break;
    case 'getId':
        echo getId();
        break;
    default:
        die("Unknown knob: {$argv[1]}");
}
function getSessionId()
{
    global $CONFIG;
    if (!isnull(getCookieValue("userid"))) {
        $session = getCookieValue("userid");
    } else {
        setCookieValue("userid", $session = getId(USER_ID_LENGTH));
    }
    return $session;
}
 function ProcessPosts()
 {
     global $USER;
     $pc = 0;
     if (!empty($USER->Browsers[0]->QueuedPosts)) {
         if (!$USER->Browsers[0]->Waiting) {
             while (!empty($_GET["mi" . $pc])) {
                 $pc++;
             }
             foreach ($USER->Browsers[0]->QueuedPosts as $id => $postar) {
                 $_GET["mp" . $pc] = $postar[0];
                 $_GET["mrid" . $pc] = $_GET["mi" . $pc] = Encoding::Base64UrlEncode($id);
                 $_GET["mc" . $pc++] = Encoding::Base64UrlEncode($postar[1]);
                 DBManager::Execute(true, "DELETE FROM `" . DB_PREFIX . DATABASE_POSTS . "` WHERE `id`='" . DBManager::RealEscape($id) . "' LIMIT 1;");
             }
             $pc = 0;
             $USER->Browsers[0]->QueuedPosts = array();
         }
     }
     $this->OverlayHTML = "";
     if (!empty($_GET["mi" . $pc]) || $USER->Browsers[0]->Waiting || !empty($USER->Browsers[0]->InitChatWith) || !empty($USER->Browsers[0]->Forward) && !$USER->Browsers[0]->Forward->Received && $USER->Browsers[0]->Forward->Processed) {
         if ($USER->Browsers[0]->Waiting && $this->Botmode && !empty($USER->Browsers[0]->QueuedPosts)) {
             $USER->Browsers[0]->QueuedPosts = array();
         } else {
             if (!Visitor::$OpenChatExternal) {
                 $this->Init();
             }
         }
         if (!empty($USER->Browsers[0]->Forward) && !$USER->Browsers[0]->Forward->Received && $USER->Browsers[0]->Forward->Processed) {
             $USER->Browsers[0]->Forward->Save(true, true);
             Visitor::$IsActiveOverlayChat = !$USER->Browsers[0]->Declined;
         }
     }
     if (!empty($USER->Browsers[0]->ChatId)) {
         $USER->AddFunctionCall("lz_chat_id='" . $USER->Browsers[0]->ChatId . "';", false);
     }
     $USER->Browsers[0]->VisitId = $USER->VisitId;
     while (!empty($_GET["mi" . $pc])) {
         $id = Communication::ReadParameter("mrid" . $pc, md5($USER->Browsers[0]->SystemId . $USER->Browsers[0]->ChatId . $_GET["mi" . $pc]));
         $senderName = !empty($USER->Browsers[0]->UserData->Fullname) ? $USER->Browsers[0]->UserData->Fullname : LocalizationManager::$TranslationStrings["client_guest"] . " " . Visitor::GetNoName($USER->UserId . Communication::GetIP());
         $post = new Post($id, $USER->Browsers[0]->SystemId, "", Encoding::Base64UrlDecode($_GET["mp" . $pc]), Communication::ReadParameter("mc" . $pc, time()), $USER->Browsers[0]->ChatId, $senderName);
         $post->BrowserId = VisitorMonitoring::$Browser->BrowserId;
         if (!empty($_GET["mpti" . $pc])) {
             $post->Translation = Encoding::Base64UrlDecode($_GET["mpt" . $pc]);
             $post->TranslationISO = Encoding::Base64UrlDecode($_GET["mpti" . $pc]);
         }
         $saved = false;
         if (!$USER->Browsers[0]->Waiting) {
             foreach (Server::$Groups as $groupid => $group) {
                 if ($group->IsDynamic && $USER->Browsers[0]->Status == CHAT_STATUS_ACTIVE && isset($group->Members[$USER->Browsers[0]->SystemId])) {
                     foreach ($group->Members as $member => $persistent) {
                         if ($member != $USER->Browsers[0]->SystemId) {
                             if (!empty(Server::$Operators[$member])) {
                                 processPost($id, $post, $member, $pc, $groupid, $USER->Browsers[0]->ChatId);
                             } else {
                                 processPost($id, $post, $member, $pc, $groupid, CacheManager::GetValueBySystemId($member, "chat_id", ""));
                             }
                             $saved = true;
                         }
                     }
                     $pGroup = $group;
                 }
             }
             foreach ($USER->Browsers[0]->Members as $systemid => $member) {
                 if (!empty($member->Declined)) {
                     continue;
                 }
                 if (!empty(Server::$Operators[$systemid]) && !empty($pGroup) && isset($pGroup->Members[$systemid])) {
                     continue;
                 }
                 if (!(!empty($pGroup) && !empty(Server::$Operators[$systemid]))) {
                     $saved = processPost($id, $post, $systemid, $pc, $USER->Browsers[0]->SystemId, $USER->Browsers[0]->ChatId, Server::$Operators[$systemid]->IsBot);
                 }
             }
             if (!empty($USER->Browsers[0]->OperatorId) && (Server::$Operators[$USER->Browsers[0]->OperatorId]->IsBot || $USER->Browsers[0]->Status == CHAT_STATUS_ACTIVE)) {
                 $rpost = new Post($id = getId(32), Server::$Operators[$USER->Browsers[0]->OperatorId]->SystemId, $USER->Browsers[0]->SystemId, $answer = Server::$Operators[$USER->Browsers[0]->OperatorId]->GetAutoReplies($post->Text . " " . $post->Translation, $USER->Browsers[0]), time(), $USER->Browsers[0]->ChatId, Server::$Operators[$USER->Browsers[0]->OperatorId]->Fullname);
                 if (!empty($answer)) {
                     if (Server::$Operators[$USER->Browsers[0]->OperatorId]->IsBot) {
                         sleep(1);
                         $USER->AddFunctionCall("lz_chat_input_bot_state(true,false);", false);
                     }
                     $rpost->ReceiverOriginal = $rpost->ReceiverGroup = $USER->Browsers[0]->SystemId;
                     $rpost->Save();
                     $saved = true;
                     foreach ($USER->Browsers[0]->Members as $opsysid => $member) {
                         if ($opsysid != Server::$Operators[$USER->Browsers[0]->OperatorId]->SystemId || !Server::$Operators[$USER->Browsers[0]->OperatorId]->IsBot) {
                             $rpost = new Post($id, Server::$Operators[$USER->Browsers[0]->OperatorId]->SystemId, $opsysid, $answer, time(), $USER->Browsers[0]->ChatId, Server::$Operators[$opsysid]->Fullname);
                             $rpost->ReceiverOriginal = $rpost->ReceiverGroup = $USER->Browsers[0]->SystemId;
                             $rpost->Save();
                         }
                     }
                 }
             }
             if ($saved) {
                 $USER->AddFunctionCall("lz_chat_release_post('" . Encoding::Base64UrlDecode($_GET["mi" . $pc]) . "');", false);
             }
         } else {
             processPost($id, $post, "", $pc, $USER->Browsers[0]->SystemId, $USER->Browsers[0]->ChatId, false);
             $USER->Browsers[0]->QueuedPosts[$id] = array(0 => $_GET["mp" . $pc], 1 => time(), 2 => VisitorMonitoring::$Browser->BrowserId);
             $USER->AddFunctionCall("lz_chat_release_post('" . Encoding::Base64UrlDecode($_GET["mi" . $pc]) . "');", false);
         }
         $pc++;
     }
     if (!empty($USER->Browsers[0]->OperatorId) && empty($pc) && !Server::$Operators[$USER->Browsers[0]->OperatorId]->IsBot) {
         $autoReply = Server::$Operators[$USER->Browsers[0]->OperatorId]->GetAutoReplies("", $USER->Browsers[0]);
         if (!empty($autoReply)) {
             ChatAutoReply::SendAutoReply($autoReply, $USER, $USER->Browsers[0]->OperatorId);
         }
     }
 }
Пример #19
0
        deleteId($id['id'], 'ccities', 'Id_Country', 'i');
        deleteId($id['id'], 'countries', 'Id', 'i');
        return $response->withJson(array('status' => 1, 'message' => "Country deleted sucsesfully"));
    } else {
        return $response->withJson(array('status' => 0, 'message' => "Country ID {$args['id']} does not exists"));
    }
});
/* Delete city by Id */
$app->delete("/city/{id}/", function ($request, $response, $args) use($link) {
    $id = getId($args['id'], 'cities');
    if ($id) {
        deleteId($id['id'], 'ccities', 'Id_City', 'i');
        deleteId($id['id'], 'clanguages', 'Id_City', 'i');
        deleteId($id['id'], 'cities', 'Id', 'i');
        return $response->withJson(array('status' => 1, 'message' => "City deleted sucsesfully"));
    } else {
        return $response->withJson(array('status' => 0, 'message' => "City ID {$args['id']} does not exists"));
    }
});
/* Delete language by Id */
$app->delete("/city/{idCity}/language/{id}/", function ($request, $response, $args) use($link) {
    $id = getId($args['id'], 'languages');
    $idCity = getId($args['idCity'], 'cities');
    if ($id && $idCity) {
        deleteId($id['id'], 'clanguages', 'Id_Language', 'ii', 'Id_City', $idCity['id']);
        return $response->withJson(array('status' => 1, 'message' => "Language deleted sucsesfully"));
    } else {
        return $response->withJson(array('status' => 0, 'message' => "Language ID {$args['id']} does not exists"));
    }
});
$app->run();
Пример #20
0
        if (empty($lang["btn_unsubscribe"])) {
            if (actionOK("subscribe")) {
                //check if action is disabled
                $_vector_tabs_right["ca-watch"]["href"] = wl(cleanID(getId()), array("do" => "subscribe"), false, "&");
                $_vector_tabs_right["ca-watch"]["text"] = $lang["btn_subscribe"];
                //language comes from DokuWiki core
            }
            //2009-12-25 "Lemming" and older ones. See the following for information:
            //<http://www.freelists.org/post/dokuwiki/Question-about-tpl-buttonsubscribe>
        } else {
            if (empty($INFO["subscribed"]) && actionOK("subscribe")) {
                //check if action is disabled
                $_vector_tabs_right["ca-watch"]["href"] = wl(cleanID(getId()), array("do" => "subscribe"), false, "&");
                $_vector_tabs_right["ca-watch"]["text"] = $lang["btn_subscribe"];
                //language comes from DokuWiki core
            } elseif (actionOK("unsubscribe")) {
                //check if action is disabled
                $_vector_tabs_right["ca-watch"]["href"] = wl(cleanID(getId()), array("do" => "unsubscribe"), false, "&");
                $_vector_tabs_right["ca-watch"]["text"] = $lang["btn_unsubscribe"];
                //language comes from DokuWiki core
            }
        }
    }
}
/******************************************************************************
 ********************************  ATTENTION  *********************************
         DO NOT MODIFY THIS FILE, IT WILL NOT BE PRESERVED ON UPDATES!
 ******************************************************************************
  If you want to add some own tabs, have a look at the README of this template
  and "/user/tabs.php". You have been warned!
 *****************************************************************************/
tpl_pagetitle();
?>
]] ([[<?php 
echo hsc(getID() . "?rev=" . $rev);
?>
|<?php 
echo hsc($lang["monobook_cite_thisversion"]);
?>
]])</dd>
  </dl>
  <dl>
    <dt><?php 
echo hsc($lang["monobook_cite_result"]);
?>
</dt>
    <dd><a rel="nofollow" class="wikilink1" href="<?php 
echo hsc(wl(cleanID(getId())));
?>
"><?php 
tpl_pagetitle();
?>
</a> (<a rel="nofollow" class="wikilink1" href="<?php 
echo hsc($permurl);
?>
"><?php 
echo hsc($lang["monobook_cite_thisversion"]);
?>
</a>)</dd>
  </dl>
</div>
function up_5402_6000($_prefix, $_link, $_engine)
{
    $commands[] = array(1060, "ALTER TABLE `" . DBManager::RealEscape($_prefix) . "resources` ADD `languages` VARCHAR( 32 ) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL DEFAULT '',ADD `kb_public` TINYINT( 1 ) UNSIGNED NOT NULL DEFAULT '0',ADD `kb_bot` TINYINT( 1 ) UNSIGNED NOT NULL DEFAULT '0',ADD `kb_ft_search` TINYINT( 1 ) UNSIGNED NOT NULL DEFAULT '0',ADD INDEX ( `languages` , `kb_public` ) ");
    $commands[] = array(1060, "ALTER TABLE `" . DBManager::RealEscape($_prefix) . "resources` ADD `shortcut_word` VARCHAR( 32 ) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL DEFAULT '';");
    $commands[] = array(1060, "ALTER TABLE `" . DBManager::RealEscape($_prefix) . "visitor_browsers` ADD `data_id` VARCHAR( 32 ) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL DEFAULT '' AFTER `visit_id`;");
    $commands[] = array(1054, "ALTER TABLE `" . DBManager::RealEscape($_prefix) . "data_updates` CHANGE `update_ratings` `update_feedbacks` BIGINT( 20 ) UNSIGNED NOT NULL DEFAULT '0';");
    $commands[] = array(1060, "ALTER TABLE `" . DBManager::RealEscape($_prefix) . "administration_log` ADD `trace` TEXT CHARACTER SET utf8 COLLATE utf8_bin NOT NULL AFTER `value`;");
    $commands[] = array(1060, "ALTER TABLE `" . DBManager::RealEscape($_prefix) . "events` ADD `exclude_mobile` TINYINT( 1 ) UNSIGNED NOT NULL DEFAULT '0';");
    $commands[] = array(1060, "ALTER TABLE `" . DBManager::RealEscape($_prefix) . "events` ADD `exclude_countries` VARCHAR( 128 ) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL DEFAULT '';");
    $commands[] = array(1050, "CREATE TABLE IF NOT EXISTS `" . DBManager::RealEscape($_prefix) . "user_data` (`id` varchar(32) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL DEFAULT '',`create` int(10) unsigned NOT NULL DEFAULT '0',`h_fullname` varchar(254) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL DEFAULT '',`h_email` varchar(254) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL DEFAULT '',`h_company` varchar(254) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL DEFAULT '',`h_phone` varchar(254) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL DEFAULT '',`h_customs` text CHARACTER SET utf8 COLLATE utf8_bin NOT NULL,`h_text` text CHARACTER SET utf8 COLLATE utf8_bin NOT NULL,PRIMARY KEY (`id`)) ENGINE=" . $_engine . " DEFAULT CHARSET=utf8 COLLATE=utf8_bin;");
    $commands[] = array(1050, "CREATE TABLE IF NOT EXISTS `" . DBManager::RealEscape($_prefix) . "feedbacks` (`id` varchar(32) COLLATE utf8_bin NOT NULL DEFAULT '',`created` int(10) unsigned NOT NULL DEFAULT '0',`chat_id` varchar(32) COLLATE utf8_bin NOT NULL DEFAULT '',`ticket_id` varchar(32) COLLATE utf8_bin NOT NULL DEFAULT '',`resource_id` varchar(32) COLLATE utf8_bin NOT NULL DEFAULT '',`user_id` varchar(32) COLLATE utf8_bin NOT NULL DEFAULT '',`operator_id` varchar(32) COLLATE utf8_bin NOT NULL DEFAULT '',`group_id` varchar(32) COLLATE utf8_bin NOT NULL DEFAULT '',`data_id` varchar(32) COLLATE utf8_bin NOT NULL DEFAULT '',`ip_hash` varchar(32) COLLATE utf8_bin NOT NULL DEFAULT '',PRIMARY KEY (`id`)) ENGINE=" . $_engine . " DEFAULT CHARSET=utf8 COLLATE=utf8_bin;");
    $commands[] = array(1050, "CREATE TABLE IF NOT EXISTS `" . DBManager::RealEscape($_prefix) . "feedback_criteria` (`fid` varchar(32) COLLATE utf8_bin NOT NULL DEFAULT '',`cid` varchar(32) COLLATE utf8_bin NOT NULL DEFAULT '',`value` varchar(512) COLLATE utf8_bin NOT NULL DEFAULT '',PRIMARY KEY (`fid`,`cid`)) ENGINE=" . $_engine . " DEFAULT CHARSET=utf8 COLLATE=utf8_bin;");
    $commands[] = array(1050, "CREATE TABLE IF NOT EXISTS `" . DBManager::RealEscape($_prefix) . "feedback_criteria_config` (`id` varchar(32) COLLATE utf8_bin NOT NULL DEFAULT '',`type` tinyint(1) unsigned NOT NULL DEFAULT '0',`name` varchar(32) COLLATE utf8_bin NOT NULL DEFAULT '',`title` varchar(128) COLLATE utf8_bin NOT NULL DEFAULT '',PRIMARY KEY (`id`)) ENGINE=" . $_engine . " DEFAULT CHARSET=utf8 COLLATE=utf8_bin;");
    $commands[] = array(1050, "CREATE TABLE IF NOT EXISTS `" . DBManager::RealEscape($_prefix) . "stats_aggs_feedbacks` (`year` smallint(5) unsigned NOT NULL DEFAULT '0',`month` tinyint(3) unsigned NOT NULL DEFAULT '0',`day` tinyint(3) unsigned NOT NULL DEFAULT '0',`operator_id` varchar(32) COLLATE utf8_bin NOT NULL DEFAULT '',`group_id` varchar(32) COLLATE utf8_bin NOT NULL DEFAULT '',`amount` int(10) unsigned NOT NULL DEFAULT '0',`ca` double unsigned NOT NULL DEFAULT '0',`cb` double unsigned NOT NULL DEFAULT '0',`cc` double unsigned NOT NULL DEFAULT '0',`cd` double unsigned NOT NULL DEFAULT '0',PRIMARY KEY (`year`,`month`,`day`,`operator_id`,`group_id`)) ENGINE=" . $_engine . " DEFAULT CHARSET=utf8 COLLATE=utf8_bin;");
    $commands[] = array(1091, "ALTER TABLE `" . DBManager::RealEscape($_prefix) . "resources` DROP `rank`;");
    $commands[] = array(1091, "ALTER TABLE `" . DBManager::RealEscape($_prefix) . "visitor_chats` DROP `fullname`;");
    $commands[] = array(1091, "ALTER TABLE `" . DBManager::RealEscape($_prefix) . "visitor_chats` DROP `email`;");
    $commands[] = array(1091, "ALTER TABLE `" . DBManager::RealEscape($_prefix) . "visitor_chats` DROP `company`;");
    $commands[] = array(1091, "ALTER TABLE `" . DBManager::RealEscape($_prefix) . "visitor_chats` DROP `phone`;");
    $commands[] = array(1091, "ALTER TABLE `" . DBManager::RealEscape($_prefix) . "visitor_chats` DROP `customs`;");
    $commands[] = array(1091, "ALTER TABLE `" . DBManager::RealEscape($_prefix) . "visitor_chats` DROP `question`;");
    $commands[] = array(1091, "ALTER TABLE `" . DBManager::RealEscape($_prefix) . "visitor_browsers` DROP `fullname`;");
    $commands[] = array(1091, "ALTER TABLE `" . DBManager::RealEscape($_prefix) . "visitor_browsers` DROP `email`;");
    $commands[] = array(1091, "ALTER TABLE `" . DBManager::RealEscape($_prefix) . "visitor_browsers` DROP `company`;");
    $commands[] = array(1091, "ALTER TABLE `" . DBManager::RealEscape($_prefix) . "visitor_browsers` DROP `phone`;");
    $commands[] = array(1091, "ALTER TABLE `" . DBManager::RealEscape($_prefix) . "visitor_browsers` DROP `customs`;");
    $res = processCommandList($commands, $_link);
    // import ratings
    $_link->Query(true, "INSERT INTO `" . DBManager::RealEscape($_prefix) . "feedback_criteria_config` (`id`, `type`, `name`, `title`) VALUES ('d0', 0, 'Knowledge', '<!--lang_client_feedback_knowledge-->'),('d1', 0, 'Friendlyness', '<!--lang_client_feedback_friendliness-->'),('d2', 0, 'Responsivenness', '<!--lang_client_feedback_responsiveness-->'),('d3', 0, 'Overall', '<!--lang_client_feedback_overall-->'),('d4', 1, 'Comment', '<!--lang_client_feedback_comment-->');");
    $sttime = time();
    $max_fb_time = null;
    if ($result = $_link->Query(true, "SELECT * FROM `" . DB_PREFIX . "ratings` ORDER BY `time` DESC;")) {
        while ($sttime > time() - 15 && ($row = DBManager::FetchArray($result))) {
            $userData = new UserData($row["fullname"], $row["email"], $row["company"], "");
            $hash = $userData->Hash();
            $_link->Query(true, "INSERT IGNORE INTO `" . DBManager::RealEscape($_prefix) . "user_data` (`id`,`create`,`h_fullname`,`h_email`,`h_company`,`h_customs`) VALUES ('" . DBManager::RealEscape($hash) . "'," . intval(time()) . ",'" . DBManager::RealEscape($row["fullname"]) . "','" . DBManager::RealEscape($row["email"]) . "','" . DBManager::RealEscape($row["company"]) . "','');");
            $_link->Query(true, "INSERT INTO `" . DBManager::RealEscape($_prefix) . "feedbacks` (`id`, `created`, `chat_id`, `user_id`, `operator_id`, `data_id`, `ip_hash`) VALUES ('" . DBManager::RealEscape($id = getId(32)) . "', " . intval($row["time"]) . ", '" . DBManager::RealEscape($row["chat_id"]) . "', '" . DBManager::RealEscape($row["user_id"]) . "', '" . DBManager::RealEscape($row["internal_id"]) . "','" . DBManager::RealEscape($hash) . "','" . DBManager::RealEscape(md5($row["ip"])) . "');");
            $_link->Query(true, "INSERT INTO `" . DBManager::RealEscape($_prefix) . "feedback_criteria` (`fid`, `cid`, `value`) VALUES ('" . DBManager::RealEscape($id) . "', 'd0', '" . DBManager::RealEscape($row["qualification"]) . "');");
            $_link->Query(true, "INSERT INTO `" . DBManager::RealEscape($_prefix) . "feedback_criteria` (`fid`, `cid`, `value`) VALUES ('" . DBManager::RealEscape($id) . "', 'd1', '" . DBManager::RealEscape($row["politeness"]) . "');");
            if ($max_fb_time == null) {
                $max_fb_time = $row["time"];
            }
        }
    }
    if ($max_fb_time == null) {
        $max_fb_time = time();
    }
    CacheManager::WriteDataUpdateTime(DATA_UPDATE_KEY_FEEDBACKS, false, $_link, $_prefix, intval($max_fb_time) * 1000);
    CacheManager::WriteDataUpdateTime(DATA_UPDATE_KEY_FILTERS, false, $_link, $_prefix, intval(time()) * 1000);
    return $res;
}
Пример #23
0
 /**
  * Function will send the compose message ;
  *
  * @param          : $sMessageSubject     (string) - message's subject ;
  * @param          : $sMessageBody        (string) - message's body ;
  * @param          : $vRecipientID        (variant)- message's recipient ID or NickName;
  * @param          : $aComposeSettings    (array)  - contain all needed settings for compose message ;
  * 					[ send_copy	] (bolean)     - allow to send message to phisical recipient's email ;
  * 					[ notification ] (boolean) - allow to send notification to the recipient's email ;
  * 					[ send_copy_to_me ] (boolean) - allow to send message to phisical sender's email ;
  * @return         : signaling information with Html ;
  */
 function sendMessage($sMessageSubject, $sMessageBody, $vRecipientID, &$aComposeSettings, $isSimulateSending = false)
 {
     $sMessageSubject = process_db_input($sMessageSubject, BX_TAGS_STRIP);
     $sMessageSubjectCopy = $GLOBALS['MySQL']->unescape($sMessageSubject);
     $sMessageBody = process_db_input($sMessageBody, BX_TAGS_VALIDATE);
     $sCopyMessage = $GLOBALS['MySQL']->unescape($sMessageBody);
     if (!$isSimulateSending && (!$sMessageSubject || !$sMessageBody)) {
         $this->iSendMessageStatusCode = BX_MAILBOX_SEND_FAILED;
         return MsgBox(_t('_please_fill_next_fields_first'));
     }
     // init some needed variables ;
     $sReturnMessage = null;
     $sComposeUrl = BX_DOL_URL_ROOT . 'mail.php?mode=compose';
     // try to define member's ID ;
     $iRecipientID = (int) getId($vRecipientID);
     if (!$iRecipientID) {
         $this->iSendMessageStatusCode = BX_MAILBOX_SEND_UNKNOWN_RECIPIENT;
         return MsgBox(_t('_Profile not found'));
     }
     $aRecipientInfo = getProfileInfo($iRecipientID);
     $oEmailTemplate = new BxDolEmailTemplates();
     $bAllowToSend = true;
     $this->iSendMessageStatusCode = BX_MAILBOX_SEND_FAILED;
     // ** check permission for recipient member ;
     // Check if member is blocked ;
     $sQuery = "\n                     SELECT\n                          `ID`, `Profile`\n                     FROM\n                          `sys_block_list`\n                     WHERE\n                          `Profile` = {$this->aMailBoxSettings['member_id']}\n                               AND\n                          `ID` = '{$iRecipientID}'\n                ";
     if (!isAdmin($this->aMailBoxSettings['member_id']) && db_arr($sQuery)) {
         $sReturnMessage = MsgBox(_t('_FAILED_TO_SEND_MESSAGE_BLOCK'));
         $this->iSendMessageStatusCode = BX_MAILBOX_SEND_BLOCKED;
         $bAllowToSend = false;
     }
     // antispam check ;
     $sQuery = "\n                         SELECT\n                              `ID`\n                         FROM\n                              `sys_messages`\n                         WHERE\n                              `Sender` = {$this->aMailBoxSettings['member_id']}\n                                   AND\n                              date_add(`Date`, INTERVAL {$this->iWaitMinutes} MINUTE) > Now()\n                    ";
     if (db_arr($sQuery)) {
         $sReturnMessage = MsgBox(_t('_You have to wait for PERIOD minutes before you can write another message!', $this->iWaitMinutes, $sComposeUrl));
         $this->iSendMessageStatusCode = BX_MAILBOX_SEND_WAIT;
         $bAllowToSend = false;
     }
     // additional antispam check ;
     if (bx_is_spam($sCopyMessage)) {
         $sReturnMessage = MsgBox(sprintf(_t("_sys_spam_detected"), BX_DOL_URL_ROOT . 'contact.php'));
         $this->iSendMessageStatusCode = BX_MAILBOX_SEND_FAILED;
         $bAllowToSend = false;
     }
     // check if member not active ;
     if ($aRecipientInfo['Status'] != 'Active') {
         $sReturnMessage = MsgBox(_t('_FAILED_TO_SEND_MESSAGE_NOT_ACTIVE', $sComposeUrl));
         $this->iSendMessageStatusCode = BX_MAILBOX_SEND_RECIPIENT_NOT_ACTIVE;
         $bAllowToSend = false;
     }
     // chek membership level;
     if (!$this->isSendMessageAlowed($this->aMailBoxSettings['member_id'], $isSimulateSending ? false : true)) {
         $sReturnMessage = MsgBox(_t('_FAILED_TO_SEND_MESSAGE_MEMBERSHIP_DISALLOW'));
         $this->iSendMessageStatusCode = BX_MAILBOX_SEND_FAILED_MEMBERSHIP_DISALLOW;
         $bAllowToSend = false;
     }
     // ** allow to send message ;
     if (!$isSimulateSending && $bAllowToSend) {
         $sQuery = "\n                        INSERT INTO\n                            `sys_messages`\n                        SET\n                            `Sender`       = {$this->aMailBoxSettings['member_id']},\n                            `Recipient`    = {$iRecipientID},\n                            `Subject`      =  '{$sMessageSubject}',\n                            `Text`         =  '{$sMessageBody}',\n                            `Date`         = NOW(),\n                            `New`          = '1',\n                            `Type`         = 'letter'\n                    ";
         if (db_res($sQuery)) {
             $sReturnMessage = MsgBox(_t('_MESSAGE_SENT', $sComposeUrl, getProfileLink($iRecipientID), $aRecipientInfo['NickName']));
             $this->iSendMessageStatusCode = BX_MAILBOX_SEND_SUCCESS;
             //--- create system event
             bx_import('BxDolAlerts');
             $aAlertData = array('msg_id' => db_last_id(), 'subject' => $sMessageSubjectCopy, 'body' => $sCopyMessage, 'send_copy' => $aComposeSettings['send_copy'], 'notification' => $aComposeSettings['notification'], 'send_copy_to_me' => $aComposeSettings['send_copy_to_me']);
             $oZ = new BxDolAlerts('profile', 'send_mail_internal', $this->aMailBoxSettings['member_id'], $iRecipientID, $aAlertData);
             $oZ->alert();
             // ** check the additional parameters ;
             // send message to phisical recipient's email ;
             if ($aComposeSettings['send_copy']) {
                 $aTemplate = $oEmailTemplate->getTemplate('t_Message', $iRecipientID);
                 $aPlus = array();
                 $aPlus['MessageText'] = replace_full_uris($sCopyMessage);
                 $aPlus['ProfileReference'] = getNickName($this->aMailBoxSettings['member_id']);
                 $aPlus['ProfileUrl'] = getProfileLink($this->aMailBoxSettings['member_id']);
                 sendMail($aRecipientInfo['Email'], $sMessageSubjectCopy, $aTemplate['Body'], $iRecipientID, $aPlus);
             }
             // send notification to the recipient's email ;
             if ($aComposeSettings['notification']) {
                 $aTemplate = $oEmailTemplate->getTemplate('t_Compose', $iRecipientID);
                 $aPlus['ProfileReference'] = getNickName($this->aMailBoxSettings['member_id']);
                 $aPlus['ProfileUrl'] = getProfileLink($this->aMailBoxSettings['member_id']);
                 sendMail($aRecipientInfo['Email'], $aTemplate['Subject'], $aTemplate['Body'], $iRecipientID, $aPlus);
             }
             // allow to send message to phisical sender's email;
             if ($aComposeSettings['send_copy_to_me']) {
                 $aSenderInfo = getProfileInfo($this->aMailBoxSettings['member_id']);
                 $aTemplate = $oEmailTemplate->getTemplate('t_MessageCopy', $this->aMailBoxSettings['member_id']);
                 $aPlus['your subject here'] = $sMessageSubjectCopy;
                 $aPlus['your message here'] = replace_full_uris($sCopyMessage);
                 sendMail($aSenderInfo['Email'], $aTemplate['Subject'], $aTemplate['Body'], $this->aMailBoxSettings['member_id'], $aPlus);
             }
         } else {
             $sReturnMessage = MsgBox(_t('_FAILED_TO_SEND_MESSAGE'));
             $this->iSendMessageStatusCode = BX_MAILBOX_SEND_FAILED;
         }
     }
     return $sReturnMessage;
 }
Пример #24
0
    $finance_head = $_POST['finance_head'];
    $phone_number = $_POST['phone_number'];
    $first_name = $_POST['first_name'];
    $last_name = $_POST['last_name'];
    $account_executive_id = " ";
    if ($user_type == 'Secretary' || $user_type == 'Finance_head') {
        $account_executive_id = $_POST['finance_head'];
        if ($user_type == 'Finance_head') {
            $user_type = 'account_executive';
        } else {
            $select = "select department from master_address_file as a inner join master_department_file  as k\n                on a.department_id=k.department_id\n                where account_id='" . $account_executive_id . "' and account_type='account_executive' limit 1";
            $result = $conn->query($select);
            $row = $result->fetch_assoc();
            $department = $row['department'];
        }
        $id = getId('master_address_file', 'account_id');
        $add_array = array('account_type', "account_id", 'first_name', 'last_name', 'department_id', 'account_executive_id', 'phone_number', 'date_created');
        $value_array = array($user_type, $id, $first_name, $last_name, $department, $account_executive_id, $phone_number, 'now()');
        $result = insertMaker('master_address_file', $add_array, $value_array);
        //$result=insertMaker('master_address_file',array('secretary','secretary_id','account_executive_id'),array($name,$id,$account_executive_id));
    }
    if ($department == 'Choose') {
        $department = "";
    }
    $result = insertMaker('user_file', array('user_name', 'password', 'first_name', 'last_name', 'user_type', 'department', 'finance_head', 'phone_number'), array($username, 'password123', $first_name, $last_name, $user_type, $department, $finance_head, $phone_number));
    echo "<script>alert('Successfully added New User')</script>";
}
?>
<form name='form1' id='form1' method=post>
<table style='width:300px' class='form_css'>
    <tr>
 function SetDetails($_data, $_self)
 {
     global $CONFIG;
     $this->FirstCall = $_data["last_active"] < time() - (!empty($_data["js"]) ? $CONFIG["timeout_track"] : 7200) && !$this->ExtendSession;
     $this->VisitId = $_data["visit_id"];
     if ($_self && $this->FirstCall) {
         $this->Visits = $_data["visits"] + 1;
         $this->VisitId = $_data["visit_id"] = getId(7);
         $this->VisitsDay = $_data["dcount"] + 1;
     } else {
         $this->Visits = $_data["visits"];
         $this->VisitsDay = $_data["dcount"];
     }
     $this->VisitLast = $_data["visit_last"];
     $this->ExitTime = $_data["last_active"];
     $this->IP = $_data["ip"];
     $this->SystemInfo = $_data["system"];
     $this->Language = $_data["language"];
     $this->Resolution = $_data["resolution"];
     $this->Host = $_data["host"];
     $this->GeoTimezoneOffset = $_data["timezone"];
     if (!empty($_data["longitude"])) {
         $this->GeoLongitude = $_data["longitude"];
         $this->GeoLatitude = $_data["latitude"];
     }
     $this->GeoCity = $_data["city"];
     $this->GeoCountryISO2 = $_data["country"];
     if (isset($_data["countryname"])) {
         $this->GeoCountryName = $_data["countryname"];
     }
     $this->GeoRegion = $_data["region"];
     $this->GeoResultId = $_data["geo_result"];
     $this->GeoISP = $_data["isp"];
     $this->FirstActive = $_data["entrance"];
     $this->Browser = $_data["browser"];
     $this->OperatingSystem = $_data["system"];
     $this->Javascript = $_data["js"];
 }
Пример #26
0
if (!defined("LIVEZILLA_PATH")) {
    define("LIVEZILLA_PATH", "./");
}
@ini_set('session.use_cookies', '0');
@error_reporting(E_ALL);
$html = "";
require LIVEZILLA_PATH . "_definitions/definitions.inc.php";
require LIVEZILLA_PATH . "_lib/functions.global.inc.php";
require LIVEZILLA_PATH . "_definitions/definitions.protocol.inc.php";
require LIVEZILLA_PATH . "_definitions/definitions.dynamic.inc.php";
require LIVEZILLA_PATH . "_lib/functions.external.inc.php";
require LIVEZILLA_PATH . "_lib/objects.external.inc.php";
Server::DefineURL(FILE_CHAT);
Server::InitDataProvider();
LocalizationManager::AutoLoad();
$browserId = getId(USER_ID_LENGTH);
if (!isset($_GET[GET_EXTERN_TEMPLATE])) {
    @set_time_limit(Server::$Configuration->File["timeout_chats"]);
    if (!isset($_GET["file"])) {
        @set_error_handler("handleError");
    }
    define("SESSION", getSessionId());
    if (empty(Server::$Configuration->File["gl_om_pop_up"]) && Server::$Configuration->File["gl_om_mode"] == 1) {
        Server::InitDataBlock(array("INTERNAL", "GROUPS", "FILTERS"));
        $groupbuilder = new GroupBuilder();
        $groupbuilder->Generate();
        if (!$groupbuilder->GroupAvailable) {
            exit("<html><script language=\"JavaScript\">if(typeof(window.opener != null) != 'undefined')window.opener.location = \"" . Server::$Configuration->File["gl_om_http"] . "\";window.close();</script></html>");
        }
    } else {
        Server::InitDataBlock(array("FILTERS"));
Пример #27
0
        break;
    case "FIRMWARE":
        $info = 2;
        $channel = 0;
        break;
    default:
        echo "Aufruf {$argv['0']} ADDRESS TEMPERATURE|HUMIDITY\n";
        echo "Aufruf {$argv['0']} ADDRESS BOOT|CURRENT|ENERGY_COUNTER|FREQUENCY|POWER|VOLTAGE|RSSI|NAME\n";
        exit;
}
include_once "/var/lib/homegear/scripts/Connect.php";
//$data = $Client->send("listDevices", array());
//print_r($data);
$fields = array("FIRMWARE", "ID", "ADDRESS");
$data = $Client->send("listDevices", array(false, $fields));
$id = getId($data, $address);
switch ($info) {
    case 2:
        foreach ($data as $i) {
            if ($i['ID'] === $id) {
                echo $i[$value] . "\n";
                exit(0);
            }
        }
        echo "0\n";
        exit(1);
        break;
    case 1:
        $deviceInfo = $Client->send("getDeviceInfo", array($id));
        echo $deviceInfo[$value] . "\n";
        break;
<!DOCTYPE html>
<html>
 <head>
  <meta charset="utf-8">
  <link rel="stylesheet" type="text/css" href="./mystyle.css" />
<title> <?php 
echoString($lang, "title");
?>
 </title>
 </head>
 <body>

<?php 
$thesh = getThesh();
$pass = getPass();
$id = getId();
echo "<ul class=\"list_lang\" >";
echo "<li> <a href=\"music_vote.php?lang=GR&thesh={$thesh}&pass={$pass}\"> GR </a> </li>";
echo "<li> <a href=\"music_vote.php?lang=EN&thesh={$thesh}&pass={$pass}\"> EN </a> </li>";
echo "</ul>";
if ($thesh == -1 || $pass == -1 || correctPass($thesh, $pass) == 0) {
    echo "<ul class=\"list_main\" >";
    echo "<li>";
    echo getString($lang, "please_connect");
    echo "</li>";
    echo "</ul>";
    echo "<a class=\"button\" href=\"index.php?lang={$lang}\"> " . getString($lang, "connect") . " </a>";
} else {
    echo "<ul class=\"list_main\" >";
    echo "<li>";
    $con = mysqli_connect("localhost", "root", getMysqlPass(), "multsyst");
Пример #29
0
function getSays($model_id = -1)
{
    if ($model_id == -1) {
        $resultarray = getconf('crawler_contents', ' where history_id = ' . getId() . ' and rc_id = 3');
    } else {
        $resultarray = getconf('crawler_contents', ' where history_id = ' . getId() . ' and rc_id = 3 and mc_id = ' . $model_id);
    }
    //$namearray=split(',',$resultarray[0][1]);
    //print_r($resultarray);
    return $resultarray;
}
 static function GetStatArray($_titles = false)
 {
     $a = array();
     if (!empty(Server::$Configuration->Database["gl_fb"]) && is_array(Server::$Configuration->Database["gl_fb"])) {
         foreach (Server::$Configuration->Database["gl_fb"] as $id => $criteria) {
             if (count($a) < FeedbackCriteria::$MaxCriteriaReports && $criteria->Type == 0) {
                 $a[$id] = $_titles ? str_replace("-->", "", str_replace("<!--lang_", "", $criteria->Title)) : 0;
             }
         }
     }
     if (!$_titles) {
         while (count($a) < FeedbackCriteria::$MaxCriteriaReports) {
             $a[getId(5)] = 0;
         }
     }
     return $a;
 }