Fixing 500 server error #12

Took 16 minutes
This commit is contained in:
Tobias Hopp 2020-10-05 21:59:42 +02:00
parent f612de7a5b
commit e5ec9342d5
4 changed files with 22 additions and 13 deletions

23
.idea/workspace.xml generated
View File

@ -23,7 +23,7 @@
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/controller/DefaultController.class.inc.php" beforeDir="false" afterPath="$PROJECT_DIR$/controller/DefaultController.class.inc.php" afterDir="false" />
<change beforePath="$PROJECT_DIR$/model/DefaultModel.class.inc.php" beforeDir="false" afterPath="$PROJECT_DIR$/model/DefaultModel.class.inc.php" afterDir="false" />
<change beforePath="$PROJECT_DIR$/templates/faq.tmpl.html" beforeDir="false" afterPath="$PROJECT_DIR$/templates/faq.tmpl.html" afterDir="false" />
<change beforePath="$PROJECT_DIR$/vendor/js/faq.js" beforeDir="false" afterPath="$PROJECT_DIR$/vendor/js/faq.js" afterDir="false" />
</list>
<option name="SHOW_DIALOG" value="false" />
<option name="HIGHLIGHT_CONFLICTS" value="true" />
@ -34,7 +34,7 @@
<execution />
</component>
<component name="DarkyenusTimeTracker">
<option name="totalTimeSeconds" value="94668" />
<option name="totalTimeSeconds" value="95570" />
<option name="gitIntegration" value="true" />
<option name="naggedAbout" value="1" />
</component>
@ -80,7 +80,7 @@
<updated>1601618466935</updated>
<workItem from="1601618467981" duration="36776000" />
<workItem from="1601809534320" duration="1558000" />
<workItem from="1601811106543" duration="29962000" />
<workItem from="1601811106543" duration="31335000" />
</task>
<task id="LOCAL-00001" summary="Initial commit">
<created>1601618764031</created>
@ -348,7 +348,14 @@
<option name="project" value="LOCAL" />
<updated>1601922746760</updated>
</task>
<option name="localTasksCounter" value="39" />
<task id="LOCAL-00039" summary="Update options menu">
<created>1601925651165</created>
<option name="number" value="00039" />
<option name="presentableId" value="LOCAL-00039" />
<option name="project" value="LOCAL" />
<updated>1601925651165</updated>
</task>
<option name="localTasksCounter" value="40" />
<servers />
</component>
<component name="TypeScriptGeneratedFilesManager">
@ -367,7 +374,6 @@
<option name="oldMeFiltersMigrated" value="true" />
</component>
<component name="VcsManagerConfiguration">
<MESSAGE value="Fix issue #1" />
<MESSAGE value="Done issue #5 and #3" />
<MESSAGE value="Fix issue #2" />
<MESSAGE value="Fix issue #4" />
@ -392,7 +398,8 @@
<MESSAGE value="Correct spelling" />
<MESSAGE value="Add room lock" />
<MESSAGE value="fix room lock msgs" />
<option name="LAST_COMMIT_MESSAGE" value="fix room lock msgs" />
<MESSAGE value="Update options menu" />
<option name="LAST_COMMIT_MESSAGE" value="Update options menu" />
</component>
<component name="WindowStateProjectService">
<state x="728" y="326" width="800" height="683" key="#com.intellij.execution.impl.EditConfigurationsDialog" timestamp="1601632929047">
@ -431,10 +438,10 @@
<screen x="0" y="34" width="1920" height="1046" />
</state>
<state x="441" y="192" width="1037" height="736" key="SettingsEditor/0.34.1920.1046@0.34.1920.1046" timestamp="1601632853044" />
<state x="555" y="292" width="800" height="535" key="Vcs.Push.Dialog.v2" timestamp="1601922747943">
<state x="555" y="292" width="800" height="535" key="Vcs.Push.Dialog.v2" timestamp="1601925652345">
<screen x="0" y="34" width="1920" height="1046" />
</state>
<state x="555" y="292" width="800" height="535" key="Vcs.Push.Dialog.v2/0.34.1920.1046@0.34.1920.1046" timestamp="1601922747943" />
<state x="555" y="292" width="800" height="535" key="Vcs.Push.Dialog.v2/0.34.1920.1046@0.34.1920.1046" timestamp="1601925652345" />
<state x="809" y="122" width="639" height="876" key="com.intellij.database.view.ui.AbstractDbRefactoringDialog" timestamp="1601632983240">
<screen x="0" y="34" width="1920" height="1046" />
</state>

View File

@ -58,6 +58,7 @@ class DefaultController
$view->set_placeholder( 'wasted_time', WASTED_TIME );
$room_code = mb_strtoupper( $Request->getVar( 'code', null, 'POST' ) );
$secret = $Request->getVar( 'secret', null, 'GET' );
if( empty( $room_code ) )
{
$room_code = mb_strtoupper( $Request->getVar( 'code', null, 'GET' ) );
@ -76,7 +77,10 @@ class DefaultController
return $view->getHtml();
}
$DefaultModel->setSecret( $room_id, $secret );
if( !empty( $secret ) )
{
$DefaultModel->setSecret( $room_id, $secret );
}
if( !$DefaultModel->joinRoom( $room_id ) )
{
@ -85,8 +89,6 @@ class DefaultController
}
return $view->getHtml();
}

View File

@ -56,7 +56,7 @@ class DefaultModel
return $randomString;
}
public function setSecret( int $room_id, string $secret)
public function setSecret( $room_id, string $secret)
{
setcookie( 'owner_room_' . $room_id, $secret, time()+60*60*24*365 );
}

2
vendor/js/faq.js vendored
View File

@ -273,7 +273,7 @@ function welcomeMessage()
request( 'getWelcomeInfo', {}, function( result ) {
if ( result.data.is_owner === true )
{
welcomeModalText.html( 'You are the owner of this room.<br>That means you are allowed to ask and <strong>answer</strong> questions!<br><br>To share your room code use the share-url or the room-code.' );
welcomeModalText.html( 'You are an admin of this room.<br>That means you are allowed to ask and <strong>answer</strong> questions!<br><br>To share your room code use the share-url or the room-code.' );
is_owner = true;
}
else