From 952e70363a3a4627497b19255ae1ea768707c120 Mon Sep 17 00:00:00 2001 From: Yigit Kerem Oktay Date: Fri, 27 Nov 2020 16:56:50 +0300 Subject: [PATCH] Start adding support for the moderator role --- examcreator/index.php | 7 +- examcreator/sessionkill.php | 14 - locale/tr_TR/LC_MESSAGES/skymake.mo | Bin 10965 -> 11505 bytes locale/tr_TR/LC_MESSAGES/skymake.po | 14 +- nps/widgets/dash.php | 33 +- skymake-platform.php | 938 ++++++++++++++++++++++++++++ 6 files changed, 984 insertions(+), 22 deletions(-) delete mode 100644 examcreator/sessionkill.php diff --git a/examcreator/index.php b/examcreator/index.php index a342897..8ab178a 100644 --- a/examcreator/index.php +++ b/examcreator/index.php @@ -56,9 +56,6 @@ function getRemoteIPAddress() { header("location: index.php"); exit; } -if (isset($_POST["killsession"])){ - header("location: sessionkill.php"); -} /*if($_SESSION["qn"]==$examdata["exam_qcount"]){ ?> @@ -191,7 +188,7 @@ function getRemoteIPAddress() { $sql = "INSERT INTO skymake_qanswers (examid,qn,answer,picurl) VALUES ('".$_SESSION["examid"]."', '".$qn_internal."', '".$_SESSION["lastanswer"]."','".$_POST["picurl"]."')"; if (mysqli_query($linktwo, $sql)) { - echo "SQL Query Succeeded:".$sql; + echo _("Saved successfully."); } else { $sql = "DELETE FROM skymake_qanswers WHERE examid='".$_SESSION["examid"]."' and qn='".$qn_internal."';"; if (mysqli_query($linktwo, $sql)){ @@ -199,7 +196,7 @@ function getRemoteIPAddress() { VALUES ('".$_SESSION["examid"]."', '".$qn_internal."', '".$_SESSION["lastanswer"]."','".$_POST["picurl"]."')"; if (mysqli_query($linktwo, $sql)) { - echo "SQL Query Succeeded:".$sql; + echo _("Saved successfully."); } else{ echo "Type 2 Error: " . $sql . "
" . mysqli_error($linktwo); diff --git a/examcreator/sessionkill.php b/examcreator/sessionkill.php deleted file mode 100644 index bc84180..0000000 --- a/examcreator/sessionkill.php +++ /dev/null @@ -1,14 +0,0 @@ - \ No newline at end of file diff --git a/locale/tr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Qqn2iQ2+_p3qe0jJJ(zQIA9Xhc1+Kh+x`5w+QdqMmr1bt3Az64Zp}qi%c6fi04pG5KQxa2`AuS zU5Cus)S{N83H8Kr4BCVtWOYp|zC0T<(BbFZ?4rZ9<{0`gK-LjGZ7F%UP2fP)T2Edk zQAACZ*hezSP@=Zj!>xvX%GLA>`cQLB*d9&Akwm3lLl%;~B!)~O1w`#_5BKi~{uYuI zZ!FNyU1#yw`n}tN+yvFWGvC9R$E3kYW=5^gXAruwu)%oDoGi6m*~~enyS6z zVHR22;wal+g2}euOb(s3q@wu*=93o0(T~Pvl1EyS<>VcbPL>k2ax&lTc^hsf{pX0@ zYi+pZ_5_`AB#!JP)g(j~5VZ_aO!T(AN%;M6-2eOO|KGOQo;If1dqlfFS_ifbK>iOh zB_x|XOL9q1(vPGPwG - + @@ -282,7 +282,36 @@ function doublewidget($lesson,$teacher,$time,$topic,$unit,$backgorundimage,$less - + + + + + + + + + + + + + + + + + + ?> diff --git a/skymake-platform.php b/skymake-platform.php index 6b81f8c..356d2f9 100755 --- a/skymake-platform.php +++ b/skymake-platform.php @@ -1272,6 +1272,944 @@ function loadWebMeeting(){ } } } +}elseif($user_role == "moderator"){ +if ($request == "logout" or $request == "logout/") { + $requestsuccess = true; + include "nps/widgets/dash.php"; + echo("

"._("Logging you out...")."

"); + session_destroy(); + ?> + + + + +
+
+
> +
+
+

+ +
+
+
+
+
> +
+
+

+ +
+
+
+
+
+
+
> +
+
+

+ +
+
+
+
+
> +
+
+

+ +
+
+
+
+
+
+
> +
+
+

+ +
+
+
+
+
> +
+
+

+ +
+
+
+
+ + +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+
+ 0) { + echo '
'; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + while ($row = mysqli_fetch_array($res)) { + echo ""; + echo ""; + $rolefromdb = "unverified"; + $sql = "SELECT role FROM skymake_roles WHERE username='".$row["username"]."'"; + if($result2 = mysqli_query($link2, $sql)){ + if(mysqli_num_rows($result2) == 1){ + while($rowrole = mysqli_fetch_array($result2)){ + $rolefromdb = $rowrole['role']; + } + } + + } + else{ + die("ERROR: Could not able to execute $sql. " . mysqli_error($link)); + } + echo ""; + echo ""; + } + echo ""; + echo "
"._("Username").""._("User Role")."
" . $row['username'] . "" . $rolefromdb . "
"; + } + } +} +if($request == "groups" or $request == "groups/"){ + include_once "nps/widgets/dash.php"; + $requestsuccess = true; + if(isset($_POST["delGroup"])){ + $sql = "DELETE FROM skymake_classes WHERE classid='".$_POST['groupid']."'"; + if(mysqli_query($link,$sql)){ + $sql = "DELETE FROM skymake_class_assigned WHERE classid='".$_POST['groupid']."'"; + if(mysqli_query($link,$sql)){ + $sql = "DELETE FROM skymake_assignments WHERE classid='".$_POST['groupid']."'"; + if(mysqli_query($link,$sql)){ + echo _("Success!"); + } + else { + echo _("ERROR. At step three MySQL encountered an error:").mysqli_error($link); + } + } + else { + echo _("ERROR. At step two MySQL encountered an error:").mysqli_error($link); + } + } + else { + echo _("ERROR. At step one MySQL encountered an error:").mysqli_error($link); + } + } + if(isset($_POST["addGroup"])){ + $sql = "INSERT INTO skymake_classes(classname) VALUES ('".$_POST["groupname"]."')"; + if(mysqli_query($link,$sql)){ + echo _("Success!"); + }else { + echo _("MySQL has encountered an error while creating group. ").mysqli_error($link); + } + } + ?> +
+
+
+
+ G@ID +
+ +
+ +
+ + +
+
+
+
+ +
+ " name="groupname" aria-label="groupname" aria-describedby="basic-addon1"> +
+ +
+ + + 0) { + echo '
'; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + while ($row = mysqli_fetch_array($res)) { + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + } + echo ""; + echo "
"._("Group ID").""._("Group Name").""._("Edit Users")."
" . $row['classid'] . "" . $row['classname'] . ""._("Edit")."
"; + } + } +} +if (substr($request, 0, 10) === "editgroup/") { + $requestsuccess = true; + include "nps/widgets/dash.php"; + $gid_len = strlen($request); + $gid = substr($request, 10, $gid_len); + $gid = str_replace("/", "", $gid); + $gname = ""; + $sql = "SELECT * FROM skymake_classes WHERE classid='".$gid."'"; + if ($res = mysqli_query($link, $sql)) { + if (mysqli_num_rows($res) == 1) { + while($row = mysqli_fetch_array($res)){ + $gname = $row["classname"]; + } + }else{ + die("There is no such group."); + } + + }else{ + die("There was an error with MySQL. Error:".mysqli_error($link)); + } + if(isset($_GET["deluser"])){ + $sql = "DELETE FROM skymake_class_assigned WHERE classid='".$gid."' and username='".$_GET["deluser"]."'"; + if (mysqli_query($link, $sql)) { + echo _("Success"); + }else{ + echo _("Failed while deleting. MySQL has encountered an error: ").mysqli_error($link); + } + } + if(isset($_POST["addUser"])){ + $sql = "INSERT INTO skymake_class_assigned (classid,username) VALUES ('".$gid."','".$_POST["username"]."')"; + if (mysqli_query($link, $sql)) { + echo _("Success"); + }else{ + echo _("Failed while deleting. MySQL has encountered an error: ").mysqli_error($link); + } + } + ?> +
+

+
+ + +
+ + + 0) { + echo '
'; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + while ($row = mysqli_fetch_array($res)) { + echo ""; + echo ""; + echo ""; + echo ""; + } + echo ""; + echo "
"._("Username").""._("Delete Users")."
" . $row['username'] . ""._("Delete")."
"; + } + } +} +if($request == "courses" or $request == "courses/"){ + include_once "nps/widgets/dash.php"; + $requestsuccess = true; + if(isset($_POST["delCourse"])){ + $sql = "DELETE FROM skymake_assignments WHERE lessonid='".$_POST["courseid"]."'"; + if(mysqli_query($link,$sql)){ + echo _("Success!"); + }else { + echo _("MySQL has encountered an error while creating group. ").mysqli_error($link); + } + } + if(isset($_POST["createCourse"])){ + $sql = "INSERT INTO skymake_assignments(lessonid,lesson,teacher,teacheruser,time,topic,unit,bgurl,classid) VALUES ('".$_POST["courseid"]."','".$_POST["lesson"]."','".$_POST["teacher"]."','".$_POST["teacheruser"]."','".$_POST["date"]." ".$_POST["hour"]."','".$_POST["topic"]."','".$_POST["unit"]."','".$_POST["bgurl"]."','".$_POST["classid"]."')"; + if(mysqli_query($link,$sql)){ + echo _("Success!"); + }else { + echo "MySQL has encountered an error while creating group. ".mysqli_error($link); + } + } + ?> +
+
+
+
+ +
+ +
+ +
+ + +
+
+
+
+ +
+ " name="courseid" aria-label="courseid" aria-describedby="basic-addon1" value=""> +
+
+
+ +
+ " name="lesson" aria-label="lesson" aria-describedby="basic-addon1"> +
+
+
+ +
+ " name="teacher" aria-label="Teacher's Real Name" aria-describedby="basic-addon1"> +
+
+
+ +
+ +
+
+
+ +
+ " name="topic" aria-label="topic" aria-describedby="basic-addon1"> +
+
+
+ +
+ " name="unit" aria-label="unit" aria-describedby="basic-addon1"> +
+
+
+ +
+ " name="bgurl" aria-label="bgimage" aria-describedby="basic-addon1"> +
+
+
+ +
+ +
+ + + +
+ +
+ + + 0) { + echo '
'; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + while ($row = mysqli_fetch_array($res)) { + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + } + echo ""; + echo "
"._("Course ID").""._("Lesson Name").""._("Teacher").""._("Topic").""._("Assigned Class ID").""._("Edit")."
" . $row['lessonid'] . "" . $row['lesson'] . "" . $row['teacher'] . "" . $row['topic'] . "" . $row['classid'] . ""._("Edit")."
"; + } + } +} +if (substr($request, 0, 14) === "lessoncontent/") { + $requestsuccess = true; + include "nps/widgets/dash.php"; + $cid_len = strlen($request); + $cid = substr($request, 14, $cid_len); + $cid = str_replace("/", "", $cid); + if(isset($_GET["delcontent"])){ + $sql = "DELETE FROM skymake_lessoncontent WHERE `content-id`='".$_GET["delcontent"]."'"; + if (mysqli_query($link, $sql)) { + echo _("Success"); + }else{ + echo _("Failed while deleting. MySQL has encountered an error: ").mysqli_error($link); + } + } + if(isset($_POST["addLC"])){ + $sql = "INSERT INTO skymake_lessoncontent (lessonid,`content-id`,`content-type`,`content-link`) VALUES ('".$cid."','".$_POST["llcid"]."','"."Live Class"."','"."/liveclass/".$_POST["llcid"]."')"; + if(mysqli_query($link,$sql)){ + echo _("Success!"); + }else{ + echo _("Error. ").mysqli_error($link); + } + } + if(isset($_POST["addExam"])){ + $sql = "INSERT INTO skymake_lessoncontent (lessonid,`content-id`,`content-type`,`content-link`) VALUES ('".$cid."','".$_POST["examid"]."','"."Online Exam"."','"."/oes/?examid=".$_POST["examid"]."')"; + if(mysqli_query($link,$sql)){ + echo _("Success!"); + }else{ + echo _("Error. ").mysqli_error($link); + } + } + if(isset($_POST["addUpload"])){ + $sql = "SELECT uploadlink FROM skymake_useruploads WHERE `upload_id`='".$_POST["uploadid"]."'"; + $c_link = ""; + if ($res = mysqli_query($link, $sql)) { + if(mysqli_num_rows($res) == 1){ + while($row = mysqli_fetch_array($res)){ + $c_link = $row["uploadlink"]; + } + }else{ + die(_("No such upload.")); + } + } + $sql = "INSERT INTO skymake_lessoncontent (lessonid,`content-id`,`content-type`,`content-link`) VALUES ('".$cid."','".$_POST["uploadid"]."','"."Document"."','".$c_link."')"; + if(mysqli_query($link,$sql)){ + echo _("Success!"); + }else{ + echo _("Error. ").mysqli_error($link); + } + } + + ?> +
+

+
+
+
+ +
+ " aria-label="Content ID" name="llcid" aria-describedby="basic-addon1"> +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ + + 0) { + echo '
'; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + while ($row = mysqli_fetch_array($res)) { + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + } + echo ""; + echo "
"._("Content ID").""._("Content Type").""._("Delete")."
" . $row['content-id'] . "" . $row['content-type'] . ""._("Delete")."
"; + } + } +} +if($request == "examcreate" or $request == "examcreate/"){ + include "nps/widgets/dash.php"; + $requestsuccess = true; + if(isset($_POST["createExam"])){ + $sql = "INSERT INTO skymake_examdata (examid,exam_name,exam_start,exam_end,exam_qcount,exam_type,exam_creator) VALUES ('".$_POST["exam-id"]."','".$_POST["exam-name"]."','".$_POST["exam-date"]." ".$_POST["exam-start"]."','".$_POST["exam-date"]." ".$_POST["exam-end"]."','".$_POST["exam-qcount"]."','standard','no-one')"; + if(mysqli_query($link,$sql)){ + echo _("Success!"); + }else { + echo _("Error").$sql.mysqli_error($link); + } + } + if(isset($_GET["delexam"])){ + $sql = "DELETE FROM skymake_examdata WHERE examid='".$_GET["delexam"]."'"; + if(mysqli_query($link,$sql)){ + echo _("Success!"); + }else { + echo _("Error ").$sql.mysqli_error($link); + } + } + ?> +
+
+
+
+ +
+ " name="exam-name" aria-label="Exam Name" aria-describedby="basic-addon1"> +
+
+
+ +
+ " name="exam-id" aria-label="Exam ID" aria-describedby="basic-addon1" value="OES"> +
+ + + + + + +
+
+ +
+ " name="exam-qcount" aria-label="Exam Question Count" aria-describedby="basic-addon1"> +
+ +
+ + + 0) { + echo '
'; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + while ($row = mysqli_fetch_array($res)) { + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + } + echo ""; + echo "
"._("Exam ID").""._("Exam Name").""._("Start").""._("End").""._("Questions").""._("Edit").""._("Delete")."
" . $row['examid'] . "" . $row['exam_name'] . "" . $row['exam_start'] . "" . $row['exam_end'] . "" . $row['exam_qcount'] . ""._("Edit").""._("Delete")."
"; + } + } +} + $_SESSION["teacheruser"] = $_SESSION["username"]; + if (substr($request, 0, 7) === "lesson/") { + $requestsuccess = true; + include "nps/widgets/dash.php"; + $ce_len = strlen($request); + $cenroller = substr($request, 7, $ce_len); + $cenroller = str_replace("/", "", $cenroller); + $n = getassignedlessonqueryteacher($linktwo, $cenroller); + $lessonname = getassignedlessonsteacher($link)[$n]; + if (!($lessonname == "n")) { + echo("

"._("Course Details")." | " . $lessonname . "

"); + echo(overview(getassignedlessonsteacher($link)[$n], _("Assigned to me"), getassignedtimesteacher($link)[$n], getassignedtopicsteacher($link)[$n], getassignedunitsteacher($link)[$n], getassignedbgurlsteacher($link)[$n], getassignedidsteacher($link)[$n], getlessoncontents($link, $cenroller))); + } else { + echo("

"._("This lesson does not exist. Please access your course by your own dashboard.")."

"); + } + } + if (substr($request, 0, 10) === "liveclass/") { + $requestsuccess = true; + include "nps/widgets/dash.php"; + $ce_len = strlen($request); + $cenroller = substr($request, 10, $ce_len); + $cenroller = str_replace("/", "", $cenroller); + $lctoken = getLiveClassToken($link, $cenroller, $_SESSION["classid"],false); + if (isContentValid($link, $cenroller) == true and !($lctoken == false)) { + echo("

"._("Live Class")." | SkyfallenLiveConnect ID:" . $cenroller . "

"); + ?> +
+
+
> +
+
+

+ +
+
+
+
+
> +
+
+

+ +
+
+
+
+ + "); + } else { + if (!isContentValid($link, $cenroller)) { + echo("

"._("This lesson does not exist. Please access your course by your own dashboard.")."

"); + } else { + $includedcourses = array(); + $sql = "SELECT * FROM skymake_lessoncontent WHERE `content-id`='".$cenroller."'"; + if($result = mysqli_query($link, $sql)){ + if(mysqli_num_rows($result) > 0){ + while($row = mysqli_fetch_array($result)){ + array_push($includedcourses,$row["lessonid"]); + } + // Free result set + mysqli_free_result($result); + } else{ + die(_("This content was not assigned to any course!")); + } + } else{ + die("ERROR: Could not able to execute for course $sql. " . mysqli_error($link)); + } + // Close connection + mysqli_close($link); + sleep(1); + $includedgroups = array(); + foreach($includedcourses as $oneofcourses) { + $sql = "SELECT classid FROM skymake_assignments WHERE lessonid='".$oneofcourses."'"; + if($result = mysqli_query($linktwo, $sql)){ + if(mysqli_num_rows($result) > 0){ + while($row = mysqli_fetch_array($result)){ + array_push($includedgroups,$row["classid"]); + } + // Free result set + mysqli_free_result($result); + } else{ + die(_("This content was not assigned to any course!")); + } + } else{ + die("ERROR: Could not able to execute $sql. " . mysqli_error($linktwo)); + } + } + } + $exitret = false; + $newtoken = md5(uniqid(rand(), true)); + foreach ($includedgroups as $oneofgroups){ + $ret = setLiveClassToken($linktwo, $cenroller, $oneofgroups, $newtoken); + if(!$ret){ + die(_("An error occured.")); + } if($ret) { + $exitret = true; + } + } + if($exitret){ + header("Refresh:0"); + } + + } + } + if ($request == "profile" or $request == "profile/") { + $requestsuccess = true; + include "nps/widgets/dash.php"; + echo("

"._("Log Out")."

"); + } + if ($request == "logout" or $request == "logout/") { + $requestsuccess = true; + include "nps/widgets/dash.php"; + echo("

"._("Logging you out...")."

"); + session_destroy(); + ?> + + +

Welcome to the new dashboard.
Here are your courses.Here are your grades.Here are your online exams.

"); + if(is_array(getassignedlessonsteacher($link))) { + $lessoncount = count(getassignedlessonsteacher($link)); + } else { + $lessoncount = 0; + } + if (getassignedlessonsteacher($link)[0] != "n") { + if (is_odd($lessoncount)) { + $completed_jobs = array(); + for ($n = 0; $n < $lessoncount and $n + 1 != $lessoncount; $n = $n + 2) { + echo(doublewidget(getassignedlessonsteacher($link)[$n], "Assigned to me", getassignedtimesteacher($link)[$n], getassignedtopicsteacher($link)[$n], getassignedunitsteacher($link)[$n], getassignedbgurlsteacher($link)[$n], getassignedidsteacher($link)[$n], getassignedlessonsteacher($link)[$n + 1], "Assigned to me", getassignedtimesteacher($link)[$n + 1], getassignedtopicsteacher($link)[$n + 1], getassignedunitsteacher($link)[$n + 1], getassignedbgurlsteacher($link)[$n + 1], getassignedidsteacher($link)[$n + 1])); + echo("
"); + array_push($completed_jobs, $n, $n + 1); + } + $lessoncount = $lessoncount - 1; + echo(singlewidget(getassignedlessonsteacher($link)[$lessoncount], "Assigned to me", getassignedtimesteacher($link)[$lessoncount], getassignedtopicsteacher($link)[$lessoncount], getassignedunitsteacher($link)[$lessoncount], getassignedbgurlsteacher($link)[$lessoncount], getassignedidsteacher($link)[$lessoncount])); + } else { + $completed_jobs = array(); + for ($n = 0; $n < $lessoncount; $n = $n + 2) { + echo(doublewidget(getassignedlessonsteacher($link)[$n], "Assigned to me", getassignedtimesteacher($link)[$n], getassignedtopicsteacher($link)[$n], getassignedunitsteacher($link)[$n], getassignedbgurlsteacher($link)[$n], getassignedidsteacher($link)[$n], getassignedlessonsteacher($link)[$n + 1], "Assigned to me", getassignedtimesteacher($link)[$n + 1], getassignedtopicsteacher($link)[$n + 1], getassignedunitsteacher($link)[$n + 1], getassignedbgurlsteacher($link)[$n + 1], getassignedidsteacher($link)[$n + 1])); + array_push($completed_jobs, $n, $n + 1); + } + } + } else { + echo("

"._("You are free for now.")."

"); + } + + } } if(isset($requestsuccess)) { if ($requestsuccess == false) {