Example #1
0
 private static function _getTimeFrameSetting()
 {
     global $CONFIG;
     if ($GLOBALS['timeframe']['data_object']) {
         return $GLOBALS['timeframe']['data_object']->GetTimeframe();
     }
     if ($CONFIG['timeframe']['get_timeframe_func'] == 'getUserSetting') {
         return getUserSetting("timeframe", "today");
     } else {
         return $CONFIG['timeframe']['get_timeframe_func']();
     }
 }
Example #2
0
$query = mysql_query("SELECT * FROM users WHERE username = '******'");
$arr = mysql_fetch_array($query);
$p0 = $arr['username'];
// Username
$p1 = $arr['password'];
// Password
$bg = secureForDB($_POST['backgroundUrl']);
if (isset($_POST['saveBackgroundUrl']) && $bg == "") {
    $sets = getUserData($user, "settings");
    if (!$sets == "") {
        $sets = str_replace("BG:" . getUserSetting($user, "BG"), "");
    }
    mysql_query("UPDATE users SET settings = '{$sets}' WHERE username = '******'");
} elseif (isset($_POST['saveBackgroundUrl']) && !$bg == "") {
    $sets = getUserData($user, "settings");
    $sets = str_replace("BG:" . getUserSetting($user, "BG"), "BG:" . $bg . ";", $sets);
    mysql_query("UPDATE users SET settings = '{$sets}' WHERE username = '******'");
}
if (remote_file_exists($bg) && strstr($bg, "http://")) {
    $sets = getUserData($user, "settings");
    if ($sets == "") {
        mysql_query("UPDATE users SET settings = 'BG~{$bg};' WHERE username = '******'");
    } else {
        mysql_query("UPDATE users SET settings = '{$sets};BG~{$bg};' WHERE username = '******'");
    }
}
$confirmpass = secureString($_POST['currpass']);
$pass = md5(secureForDB($_POST['pass']));
$email = secureForDB($_POST['email']);
if (isset($_POST['cnfrm'])) {
    if (isset($confirmpass)) {
Example #3
0
function expand_collapse_widget($title, $label, $buttonLabel, $buttonLink, $buttonClass, $linkMethod, $bodyClass, $auth, $fixedWidth, $forceExpandAlways = false)
{
    if ($fixedWidth) {
        echo "<div class='section-header'>";
    } else {
        echo "<div class='section-header-dynamic'>";
    }
    echo "<table><tr>";
    if ($auth) {
        // show button, since authorized
        // first prepare class string
        if ($buttonClass) {
            $class_string = "css_button_small " . htmlspecialchars($buttonClass, ENT_NOQUOTES);
        } else {
            $class_string = "css_button_small";
        }
        // next, create the link
        if ($linkMethod == "javascript") {
            echo "<td><a class='" . $class_string . "' href='javascript:;' onclick='" . $buttonLink . "'";
        } else {
            echo "<td><a class='" . $class_string . "' href='" . $buttonLink . "'";
            if (!isset($_SESSION['patient_portal_onsite'])) {
                // prevent an error from occuring when calling the function from the patient portal
                echo " onclick='top.restoreSession()'";
            }
        }
        if (!$GLOBALS['concurrent_layout']) {
            echo " target='Main'";
        }
        echo "><span>" . htmlspecialchars($buttonLabel, ENT_NOQUOTES) . "</span></a></td>";
    }
    if ($forceExpandAlways) {
        // Special case to force the widget to always be expanded
        echo "<td><span class='text'><b>" . htmlspecialchars($title, ENT_NOQUOTES) . "</b></span>";
        $indicatorTag = "style='display:none'";
    }
    $indicatorTag = isset($indicatorTag) ? $indicatorTag : "";
    echo "<td><a " . $indicatorTag . " href='javascript:;' class='small' onclick='toggleIndicator(this,\"" . htmlspecialchars($label, ENT_QUOTES) . "_ps_expand\")'><span class='text'><b>";
    echo htmlspecialchars($title, ENT_NOQUOTES) . "</b></span>";
    if (isset($_SESSION['patient_portal_onsite'])) {
        // collapse all entries in the patient portal
        $text = xl('expand');
    } else {
        if (getUserSetting($label . "_ps_expand")) {
            $text = xl('collapse');
        } else {
            $text = xl('expand');
        }
    }
    echo " (<span class='indicator'>" . htmlspecialchars($text, ENT_QUOTES) . "</span>)</a></td>";
    echo "</tr></table>";
    echo "</div>";
    if ($forceExpandAlways) {
        // Special case to force the widget to always be expanded
        $styling = "";
    } else {
        if (isset($_SESSION['patient_portal_onsite'])) {
            // collapse all entries in the patient portal
            $styling = "style='display:none'";
        } else {
            if (getUserSetting($label . "_ps_expand")) {
                $styling = "";
            } else {
                $styling = "style='display:none'";
            }
        }
    }
    if ($bodyClass) {
        $styling .= " class='" . $bodyClass . "'";
    }
    //next, create the first div tag to hold the information
    // note the code that calls this function will then place the ending div tag after the data
    echo "<div id='" . htmlspecialchars($label, ENT_QUOTES) . "_ps_expand' " . $styling . ">";
}
Example #4
0
ini_set('session.bug_compat_42', 0);
ini_set('memory_limit', '1024M');
date_default_timezone_set("Europe/London");
error_reporting(0);
// Global Variables
$user = $_SESSION['CurrentUser'];
$title = "All items - Google Drive";
$background = "/home/u220391248/public_html/images/background.jpg";
$mirrorUrl = "http://myhiddensite.kek";
//This is the "mirror url", used to hide the original URL of the site. It was very useful when the site started getting blocked when I was in school. I just changed the URL in this text file and it was back online in seconds.
$mainUrl = "/home/u220391248/public_html";
$globalPasswordStrength = 3;
$rules = "<font color=red>\n  <u>Site Rules</u><br>\n  1) Don't share your account with anyone<br>\n  2) Don't try to exploit any bugs<br>\n  3) Don't spam the chat<br>\n  4) Don't threaten other members<br>\n  5) Don't annoy the owner<br>\n  </font>";
if (!$user == "") {
    $bgImage = getUserSetting($user, "BG");
    $bgImageSize = getUserSetting($user, "BG", 2);
}
$backgroundImageSettings = "";
if ($bgImage == "") {
    $bgImage = $background;
} else {
    $size = getimagesize($bgImage);
    $w = $size[0];
    $h = $size[1];
    if ($bgImageSize == "") {
        $backgroundImageSettings = "background-size: 15%;";
    } else {
        $backgroundImageSettings = "background-size: {$bgImageSize}%;";
    }
    $backgroundImageSettings = "background-size: 15%;";
}
/**
 * Load the user setting
 * @param unknown $modulename
 * @param unknown $pid
 * @param unknown $attrib
 * @return NULL if not available or the setting
 */
function getUserLanguage($pid)
{
    $ret = getUserSetting("churchcore", $pid, "language");
    if ($ret == null) {
        $ret = DEFAULT_LANGUAGE;
    }
    return $ret;
}
Example #6
0
/**
 *
 * @param array $u userdata
 * @param bool $rember_me
 * @return NULL
 */
function login_user($u, $rember_me = false, $redirect = true)
{
    global $q, $q_orig, $config;
    if (empty($u->id)) {
        addErrorMessage(t("login.error.no.id.specified"));
        return null;
    }
    $_SESSION["email"] = $u->email;
    if (!$u->cmsuserid) {
        $u->cmsuserid = "{$u->vorname} {$u->name} [" . $u->id . "]";
        db_query("UPDATE {cdb_person}\n              SET cmsuserid=:cmsuserid\n              WHERE id=:id", array(':cmsuserid' => $u->cmsuserid, ':id' => $u->id));
    }
    if ($u->loginstr) {
        db_query("UPDATE {cdb_person}\n              SET loginstr=NULL\n              WHERE id=:id", array(':id' => $u->id));
    }
    $u->auth = getUserAuthorization($u->id);
    $_SESSION["user"] = $u;
    // TODO: make time configurable
    // login is valid for 6 days
    $cookieExpireTime = time() + 60 * 60 * 24 * 6;
    setcookie("RememberMe", $rember_me, $cookieExpireTime);
    $_SESSION["sessionid"] = random_string();
    setcookie("CC_SessionId", $_SESSION["sessionid"], $cookieExpireTime);
    $dt = new DateTime();
    db_query("UPDATE {cdb_person} SET lastlogin=NOW(), loginerrorcount=0 WHERE id=:id", array(':id' => $u->id));
    // Get language form user setting, if not available set it from current cookie
    $lang = getUserSetting("churchcore", $u->id, "language");
    if (!$lang) {
        _churchcore_savePidUserSetting("churchcore", $u->id, "language", getConf("language"));
    } else {
        setcookie("language", $lang, time() + 60 * 60 * 24 * 30);
    }
    // 30 days
    db_query("DELETE FROM {cc_session} WHERE datediff(NOW(), datum)>7");
    db_query("INSERT INTO {cc_session} (person_id, session, hostname, datum)\n            VALUES (:id, :session, :host, :date)", array(':id' => $u->id, ':session' => $_SESSION["sessionid"], ':host' => $_SERVER["HTTP_HOST"], ':date' => $dt->format('Y-m-d H:i:s')));
    if ($u->email) {
        // look for family users with the same email
        $res = db_query("SELECT * FROM {cdb_person}\n                     WHERE email=:email AND archiv_yn=0", array(":email" => $u->email));
        $family = array();
        $count = 0;
        foreach ($res as $p) {
            if ($p->id != $u->id) {
                $family[$p->id] = $p;
            }
            $count++;
            if ($count > 15) {
                break;
            }
            //no family should have more then 15 users
        }
        if (count($family)) {
            $_SESSION["family"] = $family;
        }
    }
    ct_log("Login succeed: {$u->email} with " . getVar('HTTP_USER_AGENT', "Unkown Browser", $_SERVER), 2, -1, "login");
    if ($redirect) {
        // on switching family login dont forward to login again
        if ($q != $q_orig) {
            header("Location: " . $_SERVER["REQUEST_URI"]);
        } else {
            if ($q == "login") {
                header("Location: ?q=home");
            }
        }
    }
}
Example #7
0
function expand_collapse_widget($title, $label, $buttonLabel, $buttonLink, $buttonClass, $linkMethod, $bodyClass, $auth, $fixedWidth)
{
    if ($fixedWidth) {
        echo "<div class='section-header'>";
    } else {
        echo "<div class='section-header-dynamic'>";
    }
    echo "<table><tr>";
    if ($auth) {
        // show button, since authorized
        // first prepare class string
        if ($buttonClass) {
            $class_string = "css_button_small " . htmlspecialchars($buttonClass, ENT_NOQUOTES);
        } else {
            $class_string = "css_button_small";
        }
        // next, create the link
        if ($linkMethod == "javascript") {
            echo "<td><a class='" . $class_string . "' href='javascript:;' onclick='" . $buttonLink . "'";
        } else {
            echo "<td><a class='" . $class_string . "' href='" . $buttonLink . "'" . " onclick='top.restoreSession()'";
        }
        if (!$GLOBALS['concurrent_layout']) {
            echo " target='Main'";
        }
        echo "><span>" . htmlspecialchars(xl($buttonLabel), ENT_NOQUOTES) . "</span></a></td>";
    }
    echo "<td><a href='javascript:;' class='small' onclick='toggleIndicator(this,\"" . htmlspecialchars($label, ENT_QUOTES) . "_ps_expand\")'><span class='text'><b>";
    echo htmlspecialchars($title, ENT_NOQUOTES) . "</b></span>";
    if (getUserSetting($label . "_ps_expand")) {
        $text = xl('collapse');
    } else {
        $text = xl('expand');
    }
    echo " (<span class='indicator'>" . htmlspecialchars($text, ENT_QUOTES) . "</span>)</a></td>";
    echo "</tr></table>";
    echo "</div>";
    if (getUserSetting($label . "_ps_expand")) {
        $styling = "";
    } else {
        $styling = "style='display:none'";
    }
    if ($bodyClass) {
        $styling .= " class='" . $bodyClass . "'";
    }
    //next, create the first div tag to hold the information
    // note the code that calls this function will then place the ending div tag after the data
    echo "<div id='" . htmlspecialchars($label, ENT_QUOTES) . "_ps_expand' " . $styling . ">";
}