本文整理汇总了PHP中Session::currentUser方法的典型用法代码示例。如果您正苦于以下问题:PHP Session::currentUser方法的具体用法?PHP Session::currentUser怎么用?PHP Session::currentUser使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Session
的用法示例。
在下文中一共展示了Session::currentUser方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: sendMessage
function sendMessage($to, $text)
{
$F = new Factory("phim");
$target = $to;
$group = 0;
if ($to[0] == "g") {
$group = str_replace("g", "", $to);
$to = 0;
}
$F->sA("phimFromUserID", Session::currentUser()->getID());
$F->sA("phimToUserID", $to);
$F->sA("phimTime", time());
$F->sA("phimMessage", $text);
$F->sA("phimphimGruppeID", $group);
$message = new stdClass();
$message->method = "message";
$message->content = $text;
$message->from = Session::currentUser()->getID();
$message->fromUser = Session::currentUser()->A("name");
$message->to = $to;
$message->time = time();
$message->group = $group;
$F->store();
$this->go($message, $target);
}
示例2: checkTermine
public function checkTermine()
{
$today = Util::parseDate("de_DE", date("d.m.Y"), "store");
$Kalender = mxCalGUI::getCalendarData($today, $today + 3600 * 24 * 1, Session::currentUser()->getID());
$found = false;
for ($i = 0; $i < 2; $i++) {
if ($found !== false) {
break;
}
$events = $Kalender->getEventsOnDay(date("dmY", $today + 3600 * 24 * $i));
foreach ($events as $v) {
foreach ($v as $s) {
if ($s->timestamp() > time() and $found === false) {
$found = $s;
break;
}
}
}
}
if (!$found) {
die("false");
}
$O = new stdClass();
$O->name = $found->title();
$O->start = $found->timestamp();
echo json_encode(array($O));
}
示例3: __construct
function __construct()
{
$this->customize();
if (get_class($this) != "CCAuftrag") {
parent::__construct();
return;
}
/*if(!isset($_POST["benutzer"])){
$_POST["benutzer"] = "Max";
$_POST["password"] = sha1("Max");
$_POST["belegart"] = "R";
$_POST["lead_id"] = "Vicidial-001";
$_POST["firma"] = "Furtmeier Hard- und Software";
$_POST["strasse"] = "Neuteile";
$_POST["nr"] = "8";
$_POST["plz"] = "86682";
$_POST["ort"] = "Genderkingen";
}*/
$this->loggedIn = true;
if (Session::currentUser() == null and !Users::login($_POST["benutzer"], $_POST["password"], "open3A")) {
$this->loggedIn = false;
}
$this->showZahlungsart = true;
$this->showButtonEditAddress = true;
$this->showButtonCheckWithGoogle = true;
}
示例4: deleteMe
function deleteMe()
{
if ($this->A("phimFromUserID") != Session::currentUser()->getID()) {
Red::errorD("Sie können nur eigene Nachrichten löschen!");
}
parent::deleteMe();
}
示例5: getUsers
public function getUsers()
{
if (Session::currentUser() == null) {
throw new Exception("No user logged in!");
}
$this->collector = array();
$collection = array();
try {
$ldap = self::getADConnection();
if ($ldap == null) {
return;
}
$LD = LoginData::get("ADServerUserPass");
$result = ldap_search($ldap, $LD->A("optionen"), "(&(objectCategory=person)(samaccountname=*))");
if (function_exists("ldap_sort")) {
ldap_sort($ldap, $result, "sn");
}
$info = ldap_get_entries($ldap, $result);
foreach ($info as $user) {
if (!isset($user["samaccountname"])) {
continue;
}
$R = self::getADEntry($user);
$U = new User($R->UserID);
$U->setA($R);
$collection[] = $U;
}
} catch (Exception $e) {
}
$this->collector = array_merge($this->collector, $collection);
}
示例6: getAngebote
public function getAngebote($data)
{
if (!$this->loggedIn) {
return "TIMEOUT";
}
$html = "";
$T = new HTMLTable(2);
#, "Bitte wählen Sie einen Lieferschein");
$T->setTableStyle("width:100%;margin-top:10px;");
$T->setColWidth(1, 130);
$T->useForSelection(false);
$T->maxHeight(400);
$AC = anyC::get("GRLBM", "isA", "1");
$AC->addJoinV3("Auftrag", "AuftragID", "=", "AuftragID");
$AC->addAssocV3("UserID", "=", Session::currentUser()->getID());
$AC->addAssocV3("status", "=", "open");
#$AC->addOrderV3("datum", "DESC");
$AC->addOrderV3("nummer", "DESC");
#$AC->setLimitV3(100);
#$AC->addJoinV3("Adresse", "t2.AdresseID", "=", "AdresseID");
$i = 0;
while ($B = $AC->n()) {
$Adresse = new Adresse($B->A("AdresseID"));
$T->addRow(array("<span style=\"font-size:20px;font-weight:bold;\">" . $B->A("prefix") . $B->A("nummer") . "</span><br><span style=\"color:grey;\">" . Util::CLDateParser($B->A("datum")) . "</span>", $Adresse->getHTMLFormattedAddress()));
$T->addCellStyle(1, "vertical-align:top;");
$T->addRowStyle("cursor:pointer;border-bottom:1px solid #ccc;");
#if($i % 2 == 1)
# $T->addRowStyle ("background-color:#eee;");
$T->addRowEvent("click", "\n\t\t\t\t\$(this).addClass('selected');\n\t\t\t\t\n\t\t\t\tCustomerPage.rme('getAuftrag', {GRLBMID: " . $B->getID() . "}, function(transport){ \n\t\t\t\t\t\tif(transport == 'TIMEOUT') { document.location.reload(); return; } \n\t\t\t\t\t\t\$('#contentLeft').html(transport); \n\t\t\t\t\t}, \n\t\t\t\t\tfunction(){},\n\t\t\t\t\t'POST');\n\t\t\t\t\t\n\t\t\t\tCustomerPage.rme('getArtikel', {GRLBMID: " . $B->getID() . ", query : '', KategorieID: ''}, function(transport){ \n\t\t\t\t\t\tif(transport == 'TIMEOUT') { document.location.reload(); return; } \n\t\t\t\t\t\t\$('#contentRight').html(transport); \n\t\t\t\t\t\t\$('.selected').removeClass('selected');\n\t\t\t\t\t\t\$('#frameSelect').hide(); \$('#frameEdit').show();\n\t\t\t\t\t}, \n\t\t\t\t\tfunction(){},\n\t\t\t\t\t'POST');");
$i++;
}
$html .= $T;
return $html;
}
示例7: createNewServer
public function createNewServer()
{
$F = new Factory("xCal");
$F->sA("xCalServerActive", "1");
$F->sA("xCalUserID", Session::currentUser()->getID());
$F->store();
}
示例8: __construct
function __construct()
{
$_SESSION["viaInterface"] = true;
if (isset($_GET["cloud"]) and !isset($_SESSION["phynx_customer"])) {
$_SESSION["phynx_customer"] = $_GET["cloud"];
}
$this->loggedIn = Session::currentUser() != null;
}
示例9: getHTML
public function getHTML($id, $page)
{
$this->addAssocV3("phimGruppeMasterUserID", "=", Session::currentUser()->getID());
$this->loadMultiPageMode($id, $page, 0);
$gui = new HTMLGUIX($this);
$gui->version("mphim");
$gui->name("Gruppe");
$B = $gui->addSideButton("Zurück", "back");
$B->loadPlugin("contentRight", "mphim");
$gui->attributes(array("phimGruppeName"));
return $gui->getBrowserHTML($id);
}
示例10: getAppServerUsers
private function getAppServerUsers()
{
$S = Util::getAppServerClient();
try {
$collection = array();
$Users = $S->getUsers(Session::currentUser()->getA());
foreach ($Users as $UL) {
$U = new User($UL->UserID);
$U->setA($UL);
$collection[] = $U;
}
} catch (Exception $e) {
}
$this->addAssocV3("isAdmin", "=", "0");
$this->lCV3();
$this->collector = array_merge($this->collector, $collection);
}
示例11: __construct
function __construct()
{
/*if(!isset($_POST["benutzer"])){
$_POST["benutzer"] = "Max";
$_POST["password"] = sha1("Max");
$_POST["belegart"] = "R";
$_POST["lead_id"] = "Vicidial-001";
$_POST["firma"] = "Furtmeier Hard- und Software";
$_POST["strasse"] = "Neuteile";
$_POST["nr"] = "8";
$_POST["plz"] = "86682";
$_POST["ort"] = "Genderkingen";
}*/
if (Session::currentUser() == null and !Users::login($_POST["benutzer"], $_POST["password"], "open3A")) {
$this->loggedIn = false;
}
}
示例12: getAppServerClient
public static function getAppServerClient($auth = true)
{
try {
$AppServer = mUserdata::getGlobalSettingValue("AppServer", "");
if ($AppServer != "") {
$CU = Session::currentUser();
$uri = $AppServer . "/plugins/AppServer/AppServer.php";
if ($CU != null and $auth) {
$c = Session::currentUser()->getA();
return new SoapClient(null, array("location" => $uri, "uri" => $uri, "login" => $c->username, "password" => $c->SHApassword));
} else {
return new SoapClient(null, array("location" => $uri, "uri" => $uri));
}
#$user = $S->getUser($username, $password);
}
} catch (Exception $e) {
}
return null;
}
示例13: getCMSHTML
function getCMSHTML()
{
if (!isset($_SERVER['PHP_AUTH_USER']) or $_SERVER['PHP_AUTH_USER'] == "") {
header('WWW-Authenticate: Basic realm="Ticket POS"');
header('HTTP/1.0 401 Unauthorized');
die("Authentifikation fehlgeschlagen");
}
$EC = new ExtConn(Util::getRootPath());
if (!$EC->login($_SERVER['PHP_AUTH_USER'], $_SERVER['PHP_AUTH_PW'])) {
header('WWW-Authenticate: Basic realm="Ticket POS"');
header('HTTP/1.0 401 Unauthorized');
die("Authentifikation fehlgeschlagen");
}
$html = "<div style=\"width:200px;float:right;\">Angemeldet als<br /><b>" . Session::currentUser()->A("name") . "</b></div>";
$html .= "<h1>Ticket POS</h1>";
$AC = anyC::get("Seminar");
$AC->addAssocV3("SeminarVon", ">=", time() - 3600 * 48);
$Events = array();
while ($S = $AC->getNextEntry()) {
$Events[$S->getID()] = $S->A("SeminarName") . ", " . Util::CLFormatDate($S->A("SeminarVon"), true);
}
$I = new HTMLInput("currentEvent", "select", null, $Events);
$I->style("font-size:20px;width:45%;");
$html .= "<div style=\"margin-bottom:45px;\">{$I}</div>";
$TS = new CCTicketShop();
/*$count = array();
for($i = 0; $i < 21; $i++)
$count[$i] = $i;
$I = new HTMLInput("ticketCount", "select", null, $count);
$I->style("width:100%;font-size:20px;");
$IC = new Button("Weiter", "");
$IC->onclick("CustomerPage.rme('handleTicketSale', [$('select[name=currentEvent]').val(), $('select[name=ticketCount]').val()], function(){ })");
$IC->className("submitFormButton");*/
$html .= "\n\t\t<div style=\"float:right;width:45%;\">\n\t\t\t<h2 style=\"margin-bottom:10px;\">Ticketverkauf</h2>\n\t\t\t" . $TS->getCMSHTML(false) . "\n\t\t\t<!--<div style=\"border:1px dashed grey;padding:10px;margin-top:10px;\">\n\t\t\t\tAnzahl der Tickets:\n\t\t\t\t{$I}{$IC}\n\t\t\t\t<div style=\"clear:both;\"></div>\n\t\t\t</div>-->\n\t\t</div>";
$I = new HTMLInput("ticketCheck");
$I->style("width:98%;font-size:20px;");
$I->onEnter("CustomerPage.rme('handleTicketCheck', [\$('select[name=currentEvent]').val(), \$(this).val()], function(transport){ \$('#ticketValidInfo').html(transport); })");
$html .= "\n\t\t<div style=\"width:45%;\">\n\t\t\t<h2 style=\"margin-bottom:10px;\">Einlass</h2>\n\t\t\t<div style=\"border:1px dashed #BBBBBB;padding:10px;\">\n\t\t\t\tTicket-Nummer:\n\t\t\t\t{$I}\n\t\t\t\t<div id=\"ticketValidInfo\" style=\"font-size:20px;margin-top:20px;\">\n\t\t\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t</div>";
return $html;
}
示例14: __construct
function __construct()
{
parent::__construct();
$this->customize();
$bps = $this->getMyBPSData();
if (Session::isPluginLoaded("mAdressBuch")) {
$CAB = mAdressBuchGUI::getCurrent($this, false, true);
if ($CAB == "-2") {
$this->addAssocV3("type", "=", "default", "AND", "1");
$AC = anyC::get("AdressBuch");
$AC->addAssocV3("AdressBuchUserID", "=", Session::currentUser()->getID());
$AC->addAssocV3("AdressBuchTyp", "=", "2");
while ($AB = $AC->getNextEntry()) {
$this->addAssocV3("type", "=", "AB" . $AB->getID(), "OR", "1");
}
}
if ($CAB == "0") {
$this->addAssocV3("type", "=", "default");
}
if ($CAB > 0) {
$AB = new AdressBuch($CAB);
if ($AB->A("AdressBuchTyp") == "1" or $AB->A("AdressBuchTyp") == "3" or $AB->A("AdressBuchTyp") == "2" and $AB->A("AdressBuchUserID") == Session::currentUser()->getID()) {
$this->addAssocV3("type", "=", "AB" . $bps["AdressBuch"]);
}
}
}
/*if($bps == -1 OR !isset($bps["AdressBuch"]) OR $bps["AdressBuch"] == 0) $this->addAssocV3("type","=","default");
else {
$AB = new AdressBuch($bps["AdressBuch"]);
if($AB->A("AdressBuchTyp") == "1" OR $AB->A("AdressBuchTyp") == "3" OR
($AB->A("AdressBuchTyp") == "2" AND $AB->A("AdressBuchUserID") == Session::currentUser()->getID()))
$this->addAssocV3("type","=","AB".$bps["AdressBuch"]);
}*/
$this->gui = new HTMLGUI();
if ($bps != -1 and isset($bps["selectionMode"]) and (strpos($bps["selectionMode"], "Vertrag") !== false or strpos($bps["selectionMode"], "Bestellung") !== false or strpos($bps["selectionMode"], "CloudKunde") !== false or strpos($bps["selectionMode"], "Einsatzort") !== false)) {
$this->gui = new HTMLGUI2();
$this->gui->setDisplaySide("right");
}
}
示例15: saveShare
public function saveShare()
{
$args = func_get_args();
#$UD = new mUserdata();
#$UD->getAsArray("shareCalendar");
$i = 0;
$US = Users::getUsers();
while ($U = $US->getNextEntry()) {
if ($U->getID() == Session::currentUser()->getID()) {
continue;
}
if ($args[$i] != "none") {
mUserdata::setUserdataS("shareCalendarTo" . $U->getID(), $args[$i], "shareCalendar");
} else {
$UD = new mUserdata();
$UD->delUserdata("shareCalendarTo" . $U->getID());
}
$i++;
}
}