Example #1
0
 function saveMe($checkUserData = true, $output = false)
 {
     $allowedUsers = Environment::getS("allowedUsers", null);
     if ($allowedUsers !== null and $this->A("isAdmin") == "0") {
         $AC = anyC::get("User", "isAdmin", "0");
         $AC->addAssocV3("UserID", "!=", $this->getID());
         $AC->lCV3();
         if ($AC->numLoaded() >= $allowedUsers) {
             Red::errorD("Sie können keine weiteren Benutzer ohne Admin-Rechte anlegen. Bitte wenden Sie sich an den Support.");
         }
     }
     $U = new User($this->ID);
     $U->loadMe(false);
     if (mUserdata::getGlobalSettingValue("encryptionKey") == null and Session::isUserAdminS()) {
         mUserdata::setUserdataS("encryptionKey", Util::getEncryptionKey(), "eK", -1);
     }
     if ($this->A->SHApassword != "") {
         $this->A->SHApassword = sha1($this->A->SHApassword);
     } else {
         $this->A->SHApassword = $U->A("SHApassword");
     }
     if ($checkUserData) {
         mUserdata::checkRestrictionOrDie("cantEdit" . str_replace("GUI", "", get_class($this)));
     }
     $this->loadAdapter();
     $this->Adapter->saveSingle2($this->getClearClass(get_class($this)), $this->A);
     if ($output) {
         Red::messageSaved();
     }
 }
Example #2
0
 public function getHTML($id)
 {
     if ($_SESSION["S"]->checkIfUserLoggedIn() == true) {
         return -1;
     }
     $es = $_SESSION["CurrentAppPlugins"]->getMenuEntries();
     $ts = $_SESSION["CurrentAppPlugins"]->getMenuTargets();
     $icons = $_SESSION["CurrentAppPlugins"]->getIcons();
     $appIco = $_SESSION["applications"]->getApplicationIcon($_SESSION["applications"]->getActiveApplication());
     if (isset($_COOKIE["phynx_color"]) and $_COOKIE["phynx_color"] != "standard") {
         $suffix = strrchr($appIco, ".");
         $newLogo = str_replace($suffix, ucfirst($_COOKIE["phynx_color"]) . $suffix, $appIco);
         if (file_exists("." . $newLogo)) {
             $appIco = $newLogo;
         }
     }
     // <editor-fold defaultstate="collapsed" desc="Aspect:jP">
     $newAppIco = Aspect::joinPoint("appLogo", $this, __METHOD__);
     if ($newAppIco != null) {
         $appIco = $newAppIco;
     }
     // </editor-fold>
     $appMenuHidden = "";
     $appMenuDisplayed = "";
     $appMenuActive = (!$_SESSION["S"]->isUserAdmin() and (!isset($_COOKIE["phynx_layout"]) or $_COOKIE["phynx_layout"] == "fixed" or $_COOKIE["phynx_layout"] == "horizontal"));
     // <editor-fold defaultstate="collapsed" desc="Aspect:jP">
     $aspectAppMenuActive = Aspect::joinPoint("appMenuActive", $this, __METHOD__);
     if ($aspectAppMenuActive !== null) {
         $appMenuActive = $aspectAppMenuActive;
     }
     // </editor-fold>
     if ($appIco != "") {
         if (count($_SESSION["applications"]->getApplicationsList()) > 1 and !$_SESSION["S"]->isAltUser()) {
             echo "<img src=\"{$appIco}\" style=\"margin-left:10px;float:left;\" alt=\"Abmelden/Anwendung wechseln\" title=\"Abmelden/Anwendung wechseln\" onclick=\"" . Environment::getS("onLogout", "phynxContextMenu.start(this, 'Menu','1','Anwendung wechseln:','right');") . "\" />";
         } else {
             echo "<img src=\"{$appIco}\" style=\"margin-left:10px;float:left;\" alt=\"Abmelden\" title=\"Abmelden\" onclick=\"" . Environment::getS("onLogout", "userControl.doLogout();") . "\" />";
         }
     }
     if (!$_SESSION["S"]->isUserAdmin()) {
         $userHiddenPlugins = mUserdata::getHiddenPlugins();
         $U = new mUserdata();
         $U->addAssocV3("typ", "=", "TTP");
         $B = new Button(Environment::getS("renameApplication:" . $_SESSION["applications"]->getActiveApplication(), $_SESSION["applications"]->getActiveApplication()), "application");
         $B->type("icon");
         $B->className("smallTabImg");
         $B->hasMouseOverEffect(false);
         $B->id("busyBox");
         #$appMenuHidden = $this->getAppMenuOrder("appMenuHidden");
         $appMenuDisplayed = $this->getAppMenuOrder("appMenuDisplayed");
         #if($appMenuDisplayed != "" AND $appMenuHidden == "")
         #	$appMenuHidden = implode(";", array_diff(array_values($es), explode(";", $appMenuDisplayed)));
     }
     $appMenuH = "\n\t\t\t<li id=\"appMenu_emptyList\" style=\"height:auto;" . ($appMenuHidden != "emptyList" ? "display:none;" : "") . "\">Ziehen Sie Einträge auf diese Seite, um sie aus dem Menü auszublenden und nur hier anzuzeigen.</li>";
     $appMenuD = "";
     if ($appMenuActive) {
         $es = self::sort($es, $appMenuDisplayed);
     }
     #, $appMenuHidden);
     echo "\n\t\t\t<div id=\"navTabsWrapper\">";
     if ($appMenuActive) {
         echo "\n\t\t\t<div\n\t\t\t\tclass=\"navBackgroundColor navBorderColor smallTab navTab\"\n\t\t\t\tid=\"SpellbookMenuEntry\"\n\t\t\t>\n\t\t\t\t<div onclick=\"contentManager.loadPlugin('contentScreen', 'Spellbook', 'SpellbookGUI;-');\" style=\"padding:3px;padding-right:7px;padding-top:7px;\">\n\t\t\t\t{$B}\n\t\t\t\t</div>\n\t\t\t</div>";
     }
     $collapsedTabs = Environment::getS("collapsedTabs", "0") == "1";
     foreach ($es as $key => $value) {
         if (isset($userHiddenPlugins[$value])) {
             continue;
         }
         $single = $_SESSION["CurrentAppPlugins"]->isCollectionOfFlip($value);
         $anyC = new anyC();
         $text = $anyC->loadLanguageClass($single);
         if ($text != null and $text->getMenuEntry() != "") {
             $key = $text->getMenuEntry();
         }
         $t = !$_SESSION["S"]->isUserAdmin() ? $U->getUDValueCached("ToggleTab{$value}") : "big";
         if ($t == null and $collapsedTabs) {
             $t = "small";
         }
         if (isset($_COOKIE["phynx_layout"]) and ($_COOKIE["phynx_layout"] == "vertical" or $_COOKIE["phynx_layout"] == "desktop")) {
             $t = "big";
         }
         #$emptyFrame = "contentLeft";
         #if(isset($ts[$value]) AND $ts[$value] == "contentLeft") $emptyFrame = "contentRight";
         #$onclick = "contentManager.emptyFrame('contentLeft'); contentManager.emptyFrame('contentRight'); contentManager.emptyFrame('contentScreen'); contentManager.loadFrame('".(isset($ts[$value]) ? $ts[$value] : "contentRight")."', '$value', -1, 0, '{$value}GUI;-');$('windows').update('');";
         $onclick = "contentManager.loadPlugin('" . (isset($ts[$value]) ? $ts[$value] : "contentRight") . "', '{$value}', '{$value}GUI;-');";
         $B = new Button($key, $icons[$value]);
         $B->type("icon");
         $B->style("float:left;margin-right:10px;");
         $BM = new Button("Reihenfolge ändern", "./images/i2/topdown.png");
         $BM->type("icon");
         $BM->style("float:right;margin-right:5px;");
         $BM->className("appMenuHandle");
         $appMenu = "\n\t\t\t<li\n\t\t\t\tid=\"appMenu_{$value}\"\n\t\t\t\tonmouseover = \"this.className = 'navBackgroundColor';\"\n\t\t\t\tonmouseout = \"this.className = '';\"\n\t\t\t>\n\t\t\t\t{$BM}\n\t\t\t\t<div\n\t\t\t\t\tonclick=\"appMenu.hide(); {$onclick}\"\n\t\t\t\t>\n\t\t\t\t{$B}<p>{$key}</p>\n\t\t\t\t</div>\n\t\t\t</li>";
         if (strpos($appMenuHidden, $value) !== false) {
             $appMenuH .= $appMenu;
         } else {
             $appMenuD .= $appMenu;
         }
         $style = (strpos($appMenuHidden, $value) !== false and $appMenuActive) ? "style=\"display:none;\"" : "";
         echo "\n\t\t\t\t\n\t\t\t\t<div\n\t\t\t\t\tid=\"" . $value . "MenuEntry\"\n\t\t\t\t\tclass=\"navBackgroundColor navBorderColor " . (($t == null or $t == "big") ? "" : " smallTab") . " navTab\"\n\t\t\t\t\t{$style}\n\t\t\t\t\t>\n\t\t\t\t\t<img\n\t\t\t\t\t\tstyle=\"margin-top:-28px;float:left;\"\n\t\t\t\t\t\tid=\"" . $value . "TabMinimizer\"\n\t\t\t\t\t\tclass=\"navTabMinimizer\"\n\t\t\t\t\t\ttitle=\"Tab {$key} vergrößern/verkleinern\"\n\t\t\t\t\t\tonclick=\"toggleTab('{$value}');\"\n\t\t\t\t\t\tsrc=\"./images/i2/tabMinimize.png\" />\n\t\t\t\t\t\n\t\t\t\t\t<div onclick=\"{$onclick}\" style=\"padding:3px;padding-right:7px;padding-top:7px;height:18px;\">\n\n\t\t\t\t\t\t<img\n\t\t\t\t\t\t\tid=\"" . $value . "MenuImage\"\n\t\t\t\t\t\t\ttitle=\"{$key}\"\n\t\t\t\t\t\t\t" . (($t == null or $t == "big") ? "class=\"tabImg\"" : "class=\"smallTabImg\"") . "\n\t\t\t\t\t\t\tsrc=\"{$icons[$value]}\" />\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t" . (($t == null or $t == "big") ? $key : "") . "\n\t\t\t\t\t</div>\n\t\t\t\t</div>";
     }
     echo "\n\t\t\t\t<div style=\"float:none;clear:both;border:0px;height:0px;width:0px;margin:0px;padding:0px;\"></div>\n\t\t\t</div>";
     /*
     			<div id=\"appMenuContainer\" class=\"backgroundColor0 navBorderColor\" style=\"display:none;\">
     				<ul style=\"min-height:50px;\" id=\"appMenuHidden\">$appMenuH</ul>
     				<p class=\"backgroundColor2\" style=\"cursor:pointer;background-image:url(./images/navi/down.png);background-repeat:no-repeat;background-position:95% 50%;\" onclick=\"if($('appMenuDisplayedContainer').style.display == 'none') new Effect.BlindDown('appMenuDisplayedContainer'); else new Effect.BlindUp('appMenuDisplayedContainer');\">Weitere Reiter</p>
     				<div id=\"appMenuDisplayedContainer\" style=\"display:none;\"><ul style=\"min-height:50px;\" id=\"appMenuDisplayed\">$appMenuD</ul><p>Um die Sortierung der Einträge zu übernehmen, muss die Anwendung <a href=\"#\" onclick=\"Installation.reloadApp(); return false;\">neu geladen werden</a>.</p></div>
     			</div>";*/
     #echo OnEvent::script("");
     if (!$_SESSION["S"]->isUserAdmin()) {
         $ud = new mUserdata();
         $al = $ud->getUDValue("noAutoLogout", "false");
         if ($al == "true") {
             echo "<script type=\"text/javascript\">contentManager.startAutoLogoutInhibitor();</script>";
         }
     }
     try {
         $U = new User(Session::currentUser()->getID());
         echo "<script type=\"text/javascript\">\$j.datepicker.setDefaults(\$j.datepicker.regional['" . $U->A("language") . "']); " . (Session::physion() ? "\$j('#navigation').hide();" : "") . "</script>";
     } catch (Exception $e) {
     }
 }
Example #3
0
<?php

#session_name("phim_".sha1(__FILE__));
define("PHYNX_NO_SESSION_RELOCATION", true);
require "../../system/connect.php";
addClassPath(Util::getRootPath() . "ubiquitous/phim");
$username = filter_input(INPUT_GET, "username");
$password = sha1(filter_input(INPUT_GET, "password"));
if (filter_input(INPUT_GET, "token")) {
    $AC = anyC::get("phimUser", "phimUserToken", filter_input(INPUT_GET, "token"));
    $AC->addAssocV3("phimUserActive", "=", "1");
    $U = $AC->n();
    if ($U != null) {
        $AnyUser = anyC::getFirst("User");
        $Us = new Users();
        $login = $Us->doLogin(array("loginUsername" => $AnyUser->A("username"), "loginSHAPassword" => $AnyUser->A("SHApassword"), "loginPWEncrypted" => 1));
        $user = new User($U->A("phimUserUserID"));
        $user->loadMe(false);
        $username = $user->A("username");
        $password = $user->A("SHApassword");
    }
}
$U = new Users();
$login = $U->doLogin(array("loginUsername" => $username, "loginSHAPassword" => $password, "loginPWEncrypted" => 1, "anwendung" => "lightCRM"));
if (!$login) {
    emoFatalError("Sorry, ich kenne dich nicht!", "Login fehlgeschlagen! Vermutlich sind die Zugangsdaten falsch.", "Login fehlgeschlagen", false);
}
$p = new mphimGUI();
$p->chatPopup("../");
Example #4
0
 public static function getCalendarCategories()
 {
     $tabs = array();
     $bps = BPS::getAllProperties("mKalenderGUI");
     $tabs[] = new stdClass();
     $tabs[0]->onclick = OnEvent::reload("Screen", "_mKalenderGUI;KID:" . Session::currentUser()->getID());
     $tabs[0]->elementID = "TodoCurrentUser";
     $tabs[0]->label = "Mein Kalender";
     $tabs[0]->isCurrent = (!isset($bps["KID"]) or $bps["KID"] == Session::currentUser()->getID());
     $ACS = anyC::get("Userdata", "name", "shareCalendarTo" . Session::currentUser()->getID());
     $ACS->addAssocV3("name", "=", "shareCalendarTo0", "OR");
     while ($Share = $ACS->getNextEntry()) {
         $U = new User($Share->A("UserID"));
         $C = new stdClass();
         $C->onclick = OnEvent::reload("Screen", "_mKalenderGUI;KID:" . $U->getID());
         $C->elementID = "TodoCurrentUser";
         $C->label = $U->A("name");
         $C->isCurrent = $bps["KID"] == $U->getID();
         $tabs[] = $C;
     }
     return $tabs;
 }