|
@@ -177,14 +177,20 @@ if (!empty($_SESSION['_user']['user_id']) && !($login || $logout)) {
|
|
|
|
|
|
|
|
|
if (api_get_setting('allow_terms_conditions') == 'true') {
|
|
|
- if (isset($_POST['login']) && isset($_POST['password']) && isset($_SESSION['term_and_condition']['user_id'])) {
|
|
|
- $user_id = $_SESSION['term_and_condition']['user_id'];
|
|
|
+ if (isset($_POST['login']) && isset($_POST['password']) &&
|
|
|
+ isset($_SESSION['term_and_condition']['user_id'])
|
|
|
+ ) {
|
|
|
+
|
|
|
+ $user_id = $_SESSION['term_and_condition']['user_id'];
|
|
|
|
|
|
$legal_type = null;
|
|
|
|
|
|
if (isset($_POST['legal_info'])) {
|
|
|
$info_legal = explode(':', $_POST['legal_info']);
|
|
|
- $legal_type = LegalManager::get_type_of_terms_and_conditions($info_legal[0], $info_legal[1]);
|
|
|
+ $legal_type = LegalManager::get_type_of_terms_and_conditions(
|
|
|
+ $info_legal[0],
|
|
|
+ $info_legal[1]
|
|
|
+ );
|
|
|
}
|
|
|
|
|
|
|
|
@@ -622,9 +628,9 @@ if (!empty($_SESSION['_user']['user_id']) && !($login || $logout)) {
|
|
|
|
|
|
$user_table = Database::get_main_table(TABLE_MAIN_USER);
|
|
|
$sql = "SELECT user_id, username, password, auth_source, active, expiration_date
|
|
|
- FROM $user_table
|
|
|
- WHERE openid = '$id1'
|
|
|
- OR openid = '$id2' ";
|
|
|
+ FROM $user_table
|
|
|
+ WHERE openid = '$id1'
|
|
|
+ OR openid = '$id2' ";
|
|
|
$result = Database::query($sql);
|
|
|
if ($result !== false) {
|
|
|
if (Database::num_rows($result)>0) {
|
|
@@ -717,7 +723,9 @@ if (!empty($cDir)) {
|
|
|
|
|
|
|
|
|
|
|
|
-if (!empty($cidReq) && (!isset($_SESSION['_cid']) or (isset($_SESSION['_cid']) && $cidReq != $_SESSION['_cid']))) {
|
|
|
+if (!empty($cidReq) && (!isset($_SESSION['_cid']) or
|
|
|
+ (isset($_SESSION['_cid']) && $cidReq != $_SESSION['_cid']))
|
|
|
+) {
|
|
|
$cidReset = true;
|
|
|
$gidReset = true;
|
|
|
}
|
|
@@ -796,8 +804,8 @@ if (isset($cidReset) && $cidReset) {
|
|
|
if (!empty($_course)) {
|
|
|
|
|
|
|
|
|
- $_real_cid = $_course['real_id'];
|
|
|
- $_cid = $_course['code'];
|
|
|
+ $_real_cid = $_course['real_id'];
|
|
|
+ $_cid = $_course['code'];
|
|
|
|
|
|
Session::write('_real_cid', $_real_cid);
|
|
|
Session::write('_cid', $_cid);
|
|
@@ -853,7 +861,7 @@ if (isset($cidReset) && $cidReset) {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
-
|
|
|
+
|
|
|
if (api_get_session_id()) {
|
|
|
Session::erase('id_session');
|
|
|
Session::erase('session_name');
|
|
@@ -880,12 +888,12 @@ if (isset($cidReset) && $cidReset) {
|
|
|
}
|
|
|
|
|
|
if (empty($_SESSION['_course']) or empty($_SESSION['_cid'])) {
|
|
|
- $_cid = -1;
|
|
|
- $_course = -1;
|
|
|
+ $_cid = -1;
|
|
|
+ $_course = -1;
|
|
|
} else {
|
|
|
|
|
|
- $_cid = $_SESSION['_cid' ];
|
|
|
- $_course = $_SESSION['_course'];
|
|
|
+ $_cid = $_SESSION['_cid'];
|
|
|
+ $_course = $_SESSION['_course'];
|
|
|
|
|
|
|
|
|
|
|
@@ -1154,7 +1162,6 @@ if ((isset($uidReset) && $uidReset) || (isset($cidReset) && $cidReset)) {
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
}
|
|
|
|
|
|
|