1
0

Added LogIn (pw in db)

This commit is contained in:
Mike Schwörer 2014-05-28 10:38:11 +02:00
parent d74a13f661
commit fa36f26f2e
9 changed files with 2851 additions and 143 deletions

2279
.idea/dataSources.ids generated Normal file

File diff suppressed because it is too large Load Diff

18
.idea/dataSources.xml generated Normal file
View File

@ -0,0 +1,18 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="DataSourceManagerImpl" format="xml" hash="3960530090">
<data-source source="LOCAL" name="MySQL - @localhost" uuid="c14641f8-3a7d-4423-b87f-bc19baba1a1f">
<driver-ref>mysql</driver-ref>
<synchronize>true</synchronize>
<jdbc-driver>com.mysql.jdbc.Driver</jdbc-driver>
<jdbc-url>jdbc:mysql://localhost:3306</jdbc-url>
<user-name>root</user-name>
<driver-properties>
<property name="zeroDateTimeBehavior" value="convertToNull" />
<property name="tinyInt1isBit" value="false" />
</driver-properties>
<libraries />
</data-source>
</component>
</project>

500
.idea/workspace.xml generated
View File

@ -66,16 +66,47 @@
<file leaf-file-name="main.php" pinned="false" current="false" current-in-tab="false"> <file leaf-file-name="main.php" pinned="false" current="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/www/protected/config/main.php"> <entry file="file://$PROJECT_DIR$/www/protected/config/main.php">
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state line="67" column="24" selection-start="1393" selection-end="1393" vertical-scroll-proportion="-0.0" vertical-offset="1139" max-vertical-offset="1751"> <state line="48" column="64" selection-start="1019" selection-end="1019" vertical-scroll-proportion="-11.115385" vertical-offset="527" max-vertical-offset="1751">
<folding>
<marker date="1401264485118" expanded="true" signature="333:2035" placeholder="..." />
<marker date="1401264485118" expanded="true" signature="946:1826" placeholder="..." />
<marker date="1401264485118" expanded="true" signature="972:1025" placeholder="..." />
</folding>
</state>
</provider>
</entry>
</file>
<file leaf-file-name="ProgrammeController.php" pinned="false" current="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/www/protected/controllers/ProgrammeController.php">
<provider selected="true" editor-type-id="text-editor">
<state line="42" column="14" selection-start="1098" selection-end="1098" vertical-scroll-proportion="-15.692307" vertical-offset="306" max-vertical-offset="3128">
<folding /> <folding />
</state> </state>
</provider> </provider>
</entry> </entry>
</file> </file>
<file leaf-file-name="index.php" pinned="false" current="false" current-in-tab="false"> <file leaf-file-name="login.php" pinned="false" current="true" current-in-tab="true">
<entry file="file://$PROJECT_DIR$/www/protected/views/programme/index.php"> <entry file="file://$PROJECT_DIR$/www/protected/views/site/login.php">
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state line="21" column="0" selection-start="382" selection-end="382" vertical-scroll-proportion="-9.807693" vertical-offset="102" max-vertical-offset="680"> <state line="37" column="59" selection-start="956" selection-end="956" vertical-scroll-proportion="0.5284974" vertical-offset="323" max-vertical-offset="1020">
<folding />
</state>
</provider>
</entry>
</file>
<file leaf-file-name="main.php" pinned="false" current="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/www/protected/views/layouts/main.php">
<provider selected="true" editor-type-id="text-editor">
<state line="49" column="79" selection-start="1922" selection-end="1922" vertical-scroll-proportion="-8.423077" vertical-offset="614" max-vertical-offset="1785">
<folding />
</state>
</provider>
</entry>
</file>
<file leaf-file-name="main.php" pinned="false" current="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/demos/default/protected/views/layouts/main.php">
<provider selected="true" editor-type-id="text-editor">
<state line="35" column="138" selection-start="1532" selection-end="1750" vertical-scroll-proportion="-11.115385" vertical-offset="306" max-vertical-offset="1105">
<folding /> <folding />
</state> </state>
</provider> </provider>
@ -84,7 +115,7 @@
<file leaf-file-name="index.php" pinned="false" current="false" current-in-tab="false"> <file leaf-file-name="index.php" pinned="false" current="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/www/protected/views/site/index.php"> <entry file="file://$PROJECT_DIR$/www/protected/views/site/index.php">
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state line="19" column="23" selection-start="315" selection-end="315" vertical-scroll-proportion="-12.423077" vertical-offset="0" max-vertical-offset="1564"> <state line="45" column="42" selection-start="748" selection-end="1003" vertical-scroll-proportion="-11.769231" vertical-offset="459" max-vertical-offset="1564">
<folding> <folding>
<marker date="1401262284212" expanded="true" signature="824:847" placeholder="SELECT * FRO..programme..." /> <marker date="1401262284212" expanded="true" signature="824:847" placeholder="SELECT * FRO..programme..." />
</folding> </folding>
@ -92,69 +123,32 @@
</provider> </provider>
</entry> </entry>
</file> </file>
<file leaf-file-name="main.php" pinned="false" current="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/www/protected/views/layouts/main.php">
<provider selected="true" editor-type-id="text-editor">
<state line="44" column="85" selection-start="1413" selection-end="1413" vertical-scroll-proportion="-16.26923" vertical-offset="325" max-vertical-offset="1768">
<folding>
<marker date="1401259726860" expanded="true" signature="2456:2491" placeholder="..." />
</folding>
</state>
</provider>
</entry>
</file>
<file leaf-file-name="UserIdentity.php" pinned="false" current="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/www/protected/components/UserIdentity.php">
<provider selected="true" editor-type-id="text-editor">
<state line="22" column="46" selection-start="673" selection-end="673" vertical-scroll-proportion="-11.576923" vertical-offset="73" max-vertical-offset="646">
<folding />
</state>
</provider>
</entry>
</file>
<file leaf-file-name="ProgrammeHelper.php" pinned="false" current="true" current-in-tab="true">
<entry file="file://$PROJECT_DIR$/www/protected/components/ProgrammeHelper.php">
<provider selected="true" editor-type-id="text-editor">
<state line="36" column="95" selection-start="908" selection-end="908" vertical-scroll-proportion="0.19927536" vertical-offset="502" max-vertical-offset="1360">
<folding />
</state>
</provider>
</entry>
</file>
<file leaf-file-name="SeededRandom.php" pinned="false" current="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/www/protected/components/SeededRandom.php">
<provider selected="true" editor-type-id="text-editor">
<state line="35" column="27" selection-start="557" selection-end="557" vertical-scroll-proportion="-13.038462" vertical-offset="256" max-vertical-offset="850">
<folding>
<element signature="e#6#84#0" expanded="true" />
</folding>
</state>
</provider>
</entry>
</file>
<file leaf-file-name="SiteController.php" pinned="false" current="false" current-in-tab="false"> <file leaf-file-name="SiteController.php" pinned="false" current="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/www/protected/controllers/SiteController.php"> <entry file="file://$PROJECT_DIR$/www/protected/controllers/SiteController.php">
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state line="10" column="58" selection-start="183" selection-end="183" vertical-scroll-proportion="-6.5384617" vertical-offset="0" max-vertical-offset="1173"> <state line="72" column="22" selection-start="1270" selection-end="1270" vertical-scroll-proportion="-4.3846154" vertical-offset="1110" max-vertical-offset="1734">
<folding /> <folding />
</state> </state>
</provider> </provider>
</entry> </entry>
</file> </file>
<file leaf-file-name="about.php" pinned="false" current="false" current-in-tab="false"> <file leaf-file-name="LoginForm.php" pinned="false" current="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/www/protected/views/site/about.php"> <entry file="file://$PROJECT_DIR$/www/protected/models/LoginForm.php">
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state line="29" column="36" selection-start="881" selection-end="881" vertical-scroll-proportion="17.846153" vertical-offset="957" max-vertical-offset="1530"> <state line="0" column="0" selection-start="0" selection-end="0" vertical-scroll-proportion="25.5" vertical-offset="663" max-vertical-offset="1411">
<folding /> <folding />
</state> </state>
</provider> </provider>
</entry> </entry>
</file> </file>
<file leaf-file-name="ProgrammeController.php" pinned="false" current="false" current-in-tab="false"> <file leaf-file-name="UserIdentity.php" pinned="false" current="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/www/protected/controllers/ProgrammeController.php"> <entry file="file://$PROJECT_DIR$/www/protected/components/UserIdentity.php">
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state line="130" column="0" selection-start="3238" selection-end="3238" vertical-scroll-proportion="-34.0" vertical-offset="1326" max-vertical-offset="3111"> <state line="26" column="27" selection-start="804" selection-end="804" vertical-scroll-proportion="-11.807693" vertical-offset="135" max-vertical-offset="714">
<folding /> <folding>
<marker date="1401266225595" expanded="true" signature="646:705" placeholder="SELECT SValu..othervalues..." />
<marker date="1401266225595" expanded="true" signature="652:705" placeholder="select SValu..othervalues..." />
</folding>
</state> </state>
</provider> </provider>
</entry> </entry>
@ -182,20 +176,21 @@
<option value="$PROJECT_DIR$/www/protected/views/programme/create.php" /> <option value="$PROJECT_DIR$/www/protected/views/programme/create.php" />
<option value="$PROJECT_DIR$/www/protected/views/programme/update.php" /> <option value="$PROJECT_DIR$/www/protected/views/programme/update.php" />
<option value="$PROJECT_DIR$/www/protected/views/programme/view.php" /> <option value="$PROJECT_DIR$/www/protected/views/programme/view.php" />
<option value="$PROJECT_DIR$/www/protected/config/main.php" />
<option value="$PROJECT_DIR$/www/protected/views/programme/admin.php" /> <option value="$PROJECT_DIR$/www/protected/views/programme/admin.php" />
<option value="$PROJECT_DIR$/www/css/styles.css" /> <option value="$PROJECT_DIR$/www/css/styles.css" />
<option value="$PROJECT_DIR$/www/javascript/scripts.js" /> <option value="$PROJECT_DIR$/www/javascript/scripts.js" />
<option value="$PROJECT_DIR$/www/protected/models/Programme.php" /> <option value="$PROJECT_DIR$/www/protected/models/Programme.php" />
<option value="$PROJECT_DIR$/www/protected/views/site/about.php" /> <option value="$PROJECT_DIR$/www/protected/views/site/about.php" />
<option value="$PROJECT_DIR$/www/protected/controllers/ProgrammeController.php" />
<option value="$PROJECT_DIR$/www/protected/views/programme/index.php" /> <option value="$PROJECT_DIR$/www/protected/views/programme/index.php" />
<option value="$PROJECT_DIR$/www/protected/components/UserIdentity.php" />
<option value="$PROJECT_DIR$/www/protected/views/layouts/main.php" />
<option value="$PROJECT_DIR$/www/protected/controllers/SiteController.php" />
<option value="$PROJECT_DIR$/www/protected/components/SeededRandom.php" /> <option value="$PROJECT_DIR$/www/protected/components/SeededRandom.php" />
<option value="$PROJECT_DIR$/www/protected/views/site/index.php" /> <option value="$PROJECT_DIR$/www/protected/views/site/index.php" />
<option value="$PROJECT_DIR$/www/protected/components/ProgrammeHelper.php" /> <option value="$PROJECT_DIR$/www/protected/components/ProgrammeHelper.php" />
<option value="$PROJECT_DIR$/www/protected/controllers/SiteController.php" />
<option value="$PROJECT_DIR$/www/protected/views/layouts/main.php" />
<option value="$PROJECT_DIR$/www/protected/controllers/ProgrammeController.php" />
<option value="$PROJECT_DIR$/www/protected/config/main.php" />
<option value="$PROJECT_DIR$/www/protected/components/UserIdentity.php" />
<option value="$PROJECT_DIR$/www/protected/views/site/login.php" />
</list> </list>
</option> </option>
</component> </component>
@ -450,6 +445,28 @@
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" /> <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
</PATH_ELEMENT> </PATH_ELEMENT>
</PATH> </PATH>
<PATH>
<PATH_ELEMENT>
<option name="myItemId" value="www.mikescher.de" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
</PATH_ELEMENT>
<PATH_ELEMENT>
<option name="myItemId" value="www.mikescher.de" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
</PATH_ELEMENT>
<PATH_ELEMENT>
<option name="myItemId" value="www" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
</PATH_ELEMENT>
<PATH_ELEMENT>
<option name="myItemId" value="protected" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
</PATH_ELEMENT>
<PATH_ELEMENT>
<option name="myItemId" value="config" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
</PATH_ELEMENT>
</PATH>
<PATH> <PATH>
<PATH_ELEMENT> <PATH_ELEMENT>
<option name="myItemId" value="www.mikescher.de" /> <option name="myItemId" value="www.mikescher.de" />
@ -508,6 +525,206 @@
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" /> <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
</PATH_ELEMENT> </PATH_ELEMENT>
</PATH> </PATH>
<PATH>
<PATH_ELEMENT>
<option name="myItemId" value="www.mikescher.de" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
</PATH_ELEMENT>
<PATH_ELEMENT>
<option name="myItemId" value="www.mikescher.de" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
</PATH_ELEMENT>
<PATH_ELEMENT>
<option name="myItemId" value="demos" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
</PATH_ELEMENT>
</PATH>
<PATH>
<PATH_ELEMENT>
<option name="myItemId" value="www.mikescher.de" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
</PATH_ELEMENT>
<PATH_ELEMENT>
<option name="myItemId" value="www.mikescher.de" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
</PATH_ELEMENT>
<PATH_ELEMENT>
<option name="myItemId" value="demos" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
</PATH_ELEMENT>
<PATH_ELEMENT>
<option name="myItemId" value="default" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
</PATH_ELEMENT>
</PATH>
<PATH>
<PATH_ELEMENT>
<option name="myItemId" value="www.mikescher.de" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
</PATH_ELEMENT>
<PATH_ELEMENT>
<option name="myItemId" value="www.mikescher.de" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
</PATH_ELEMENT>
<PATH_ELEMENT>
<option name="myItemId" value="demos" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
</PATH_ELEMENT>
<PATH_ELEMENT>
<option name="myItemId" value="default" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
</PATH_ELEMENT>
<PATH_ELEMENT>
<option name="myItemId" value="protected" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
</PATH_ELEMENT>
</PATH>
<PATH>
<PATH_ELEMENT>
<option name="myItemId" value="www.mikescher.de" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
</PATH_ELEMENT>
<PATH_ELEMENT>
<option name="myItemId" value="www.mikescher.de" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
</PATH_ELEMENT>
<PATH_ELEMENT>
<option name="myItemId" value="demos" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
</PATH_ELEMENT>
<PATH_ELEMENT>
<option name="myItemId" value="default" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
</PATH_ELEMENT>
<PATH_ELEMENT>
<option name="myItemId" value="protected" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
</PATH_ELEMENT>
<PATH_ELEMENT>
<option name="myItemId" value="views" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
</PATH_ELEMENT>
<PATH_ELEMENT>
<option name="myItemId" value="site" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
</PATH_ELEMENT>
</PATH>
<PATH>
<PATH_ELEMENT>
<option name="myItemId" value="www.mikescher.de" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
</PATH_ELEMENT>
<PATH_ELEMENT>
<option name="myItemId" value="www.mikescher.de" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
</PATH_ELEMENT>
<PATH_ELEMENT>
<option name="myItemId" value="demos" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
</PATH_ELEMENT>
<PATH_ELEMENT>
<option name="myItemId" value="default" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
</PATH_ELEMENT>
<PATH_ELEMENT>
<option name="myItemId" value="protected" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
</PATH_ELEMENT>
<PATH_ELEMENT>
<option name="myItemId" value="views" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
</PATH_ELEMENT>
<PATH_ELEMENT>
<option name="myItemId" value="site" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
</PATH_ELEMENT>
<PATH_ELEMENT>
<option name="myItemId" value="pages" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
</PATH_ELEMENT>
</PATH>
<PATH>
<PATH_ELEMENT>
<option name="myItemId" value="www.mikescher.de" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
</PATH_ELEMENT>
<PATH_ELEMENT>
<option name="myItemId" value="www.mikescher.de" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
</PATH_ELEMENT>
<PATH_ELEMENT>
<option name="myItemId" value="demos" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
</PATH_ELEMENT>
<PATH_ELEMENT>
<option name="myItemId" value="default" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
</PATH_ELEMENT>
<PATH_ELEMENT>
<option name="myItemId" value="protected" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
</PATH_ELEMENT>
<PATH_ELEMENT>
<option name="myItemId" value="views" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
</PATH_ELEMENT>
<PATH_ELEMENT>
<option name="myItemId" value="layouts" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
</PATH_ELEMENT>
</PATH>
<PATH>
<PATH_ELEMENT>
<option name="myItemId" value="www.mikescher.de" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
</PATH_ELEMENT>
<PATH_ELEMENT>
<option name="myItemId" value="www.mikescher.de" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
</PATH_ELEMENT>
<PATH_ELEMENT>
<option name="myItemId" value="demos" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
</PATH_ELEMENT>
<PATH_ELEMENT>
<option name="myItemId" value="default" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
</PATH_ELEMENT>
<PATH_ELEMENT>
<option name="myItemId" value="protected" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
</PATH_ELEMENT>
<PATH_ELEMENT>
<option name="myItemId" value="models" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
</PATH_ELEMENT>
</PATH>
<PATH>
<PATH_ELEMENT>
<option name="myItemId" value="www.mikescher.de" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
</PATH_ELEMENT>
<PATH_ELEMENT>
<option name="myItemId" value="www.mikescher.de" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
</PATH_ELEMENT>
<PATH_ELEMENT>
<option name="myItemId" value="demos" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
</PATH_ELEMENT>
<PATH_ELEMENT>
<option name="myItemId" value="default" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
</PATH_ELEMENT>
<PATH_ELEMENT>
<option name="myItemId" value="protected" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
</PATH_ELEMENT>
<PATH_ELEMENT>
<option name="myItemId" value="controllers" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
</PATH_ELEMENT>
</PATH>
</subPane> </subPane>
</pane> </pane>
</panes> </panes>
@ -522,11 +739,13 @@
<property name="FullScreen" value="false" /> <property name="FullScreen" value="false" />
<property name="LayoutCode.rearrangeEntriesPHP" value="false" /> <property name="LayoutCode.rearrangeEntriesPHP" value="false" />
<property name="restartRequiresConfirmation" value="true" /> <property name="restartRequiresConfirmation" value="true" />
<property name="dynamic.classpath" value="false" />
</component> </component>
<component name="RecentsManager"> <component name="RecentsManager">
<key name="CopyFile.RECENT_KEYS"> <key name="CopyFile.RECENT_KEYS">
<recent name="E:\Eigene Dateien\Dropbox\Programming\Web\Mikescher.de\www.mikescher.de\www\css" /> <recent name="E:\Eigene Dateien\Dropbox\Programming\Web\Mikescher.de\www.mikescher.de\www\protected\models" />
<recent name="E:\Eigene Dateien\Dropbox\Programming\Web\Mikescher.de\www.mikescher.de\www\protected\views\site" /> <recent name="E:\Eigene Dateien\Dropbox\Programming\Web\Mikescher.de\www.mikescher.de\www\protected\views\site" />
<recent name="E:\Eigene Dateien\Dropbox\Programming\Web\Mikescher.de\www.mikescher.de\www\css" />
</key> </key>
</component> </component>
<component name="RunManager" selected="PHP HTTP Request.www.mikescher.de - About"> <component name="RunManager" selected="PHP HTTP Request.www.mikescher.de - About">
@ -559,6 +778,12 @@
<configuration default="true" type="PhpUnitRemoteRunConfigurationType" factoryName="PHPUnit on Server"> <configuration default="true" type="PhpUnitRemoteRunConfigurationType" factoryName="PHPUnit on Server">
<method /> <method />
</configuration> </configuration>
<configuration default="true" type="com.intellij.persistence.run.ConsoleRunConfigurationType" factoryName="Query Language Console">
<option name="VM_PARAMETERS" value="" />
<option name="USER_CFG_CLASS" />
<option name="CONTEXT_PROVIDER" />
<method />
</configuration>
<configuration default="false" name="www.mikescher.de - Index" type="PhpHttpRequestRunConfigurationType" factoryName="PHP HTTP Request" server_name="Localhost" url="/Index"> <configuration default="false" name="www.mikescher.de - Index" type="PhpHttpRequestRunConfigurationType" factoryName="PHP HTTP Request" server_name="Localhost" url="/Index">
<RunnerSettings RunnerId="PhpHttpRequestDebugRunner" /> <RunnerSettings RunnerId="PhpHttpRequestDebugRunner" />
<RunnerSettings RunnerId="PhpRunner" /> <RunnerSettings RunnerId="PhpRunner" />
@ -638,14 +863,14 @@
<layout> <layout>
<window_info id="Changes" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" /> <window_info id="Changes" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" />
<window_info id="Terminal" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.32873806" sideWeight="0.4997245" order="11" side_tool="false" content_ui="tabs" /> <window_info id="Terminal" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.32873806" sideWeight="0.4997245" order="11" side_tool="false" content_ui="tabs" />
<window_info id="TODO" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.32979852" sideWeight="0.4997245" order="6" side_tool="false" content_ui="tabs" /> <window_info id="TODO" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" weight="0.32943678" sideWeight="0.4997245" order="6" side_tool="false" content_ui="tabs" />
<window_info id="Database" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" /> <window_info id="Database" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" />
<window_info id="Structure" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.24958678" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" /> <window_info id="Structure" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.24958678" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
<window_info id="Framework" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.3294766" sideWeight="0.5" order="2" side_tool="false" content_ui="tabs" /> <window_info id="Framework" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.3294766" sideWeight="0.5" order="2" side_tool="false" content_ui="tabs" />
<window_info id="Project" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" weight="0.2137741" sideWeight="0.5" order="0" side_tool="false" content_ui="combo" /> <window_info id="Project" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" weight="0.2137741" sideWeight="0.5" order="0" side_tool="false" content_ui="combo" />
<window_info id="Debug" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.39766702" sideWeight="0.4997245" order="3" side_tool="false" content_ui="tabs" /> <window_info id="Debug" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.39766702" sideWeight="0.4997245" order="3" side_tool="false" content_ui="tabs" />
<window_info id="Favorites" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.2214876" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" /> <window_info id="Favorites" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.2214876" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" />
<window_info id="Event Log" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" weight="0.33722162" sideWeight="0.5002755" order="9" side_tool="true" content_ui="tabs" /> <window_info id="Event Log" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" weight="0.32943678" sideWeight="0.5002755" order="9" side_tool="true" content_ui="tabs" />
<window_info id="Run" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33722162" sideWeight="0.4997245" order="2" side_tool="false" content_ui="tabs" /> <window_info id="Run" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33722162" sideWeight="0.4997245" order="2" side_tool="false" content_ui="tabs" />
<window_info id="Version Control" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="10" side_tool="false" content_ui="tabs" /> <window_info id="Version Control" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="10" side_tool="false" content_ui="tabs" />
<window_info id="Cvs" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.25" sideWeight="0.5" order="4" side_tool="false" content_ui="tabs" /> <window_info id="Cvs" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.25" sideWeight="0.5" order="4" side_tool="false" content_ui="tabs" />
@ -680,16 +905,6 @@
</breakpoint-manager> </breakpoint-manager>
</component> </component>
<component name="editorHistoryManager"> <component name="editorHistoryManager">
<entry file="file://$PROJECT_DIR$/www/protected/extensions/bootstrap/helpers/TbArray.php">
<provider selected="true" editor-type-id="text-editor">
<state line="33" column="55" selection-start="1094" selection-end="1100" vertical-scroll-proportion="0.0" vertical-offset="561" max-vertical-offset="2652" />
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/framework/gii/assets/js/main.js">
<provider selected="true" editor-type-id="text-editor">
<state line="0" column="0" selection-start="0" selection-end="0" vertical-scroll-proportion="0.0" vertical-offset="0" max-vertical-offset="1428" />
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/www/index.php"> <entry file="file://$PROJECT_DIR$/www/index.php">
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state line="12" column="16" selection-start="412" selection-end="412" vertical-scroll-proportion="0.30357143" vertical-offset="0" max-vertical-offset="672" /> <state line="12" column="16" selection-start="412" selection-end="412" vertical-scroll-proportion="0.30357143" vertical-offset="0" max-vertical-offset="672" />
@ -835,16 +1050,6 @@
<state line="19" column="25" selection-start="500" selection-end="500" vertical-scroll-proportion="0.0" vertical-offset="323" max-vertical-offset="680" /> <state line="19" column="25" selection-start="500" selection-end="500" vertical-scroll-proportion="0.0" vertical-offset="323" max-vertical-offset="680" />
</provider> </provider>
</entry> </entry>
<entry file="file://$PROJECT_DIR$/demos/default/protected/models/LoginForm.php">
<provider selected="true" editor-type-id="text-editor">
<state line="0" column="0" selection-start="0" selection-end="0" vertical-scroll-proportion="0.0" vertical-offset="0" max-vertical-offset="1411" />
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/demos/default/protected/controllers/SiteController.php">
<provider selected="true" editor-type-id="text-editor">
<state line="0" column="0" selection-start="0" selection-end="0" vertical-scroll-proportion="0.0" vertical-offset="0" max-vertical-offset="1938" />
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/www/protected/views/programme/admin.php"> <entry file="file://$PROJECT_DIR$/www/protected/views/programme/admin.php">
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state line="46" column="7" selection-start="1087" selection-end="1087" vertical-scroll-proportion="0.0" vertical-offset="524" max-vertical-offset="1411" /> <state line="46" column="7" selection-start="1087" selection-end="1087" vertical-scroll-proportion="0.0" vertical-offset="524" max-vertical-offset="1411" />
@ -874,11 +1079,6 @@
<state line="0" column="0" selection-start="0" selection-end="0" vertical-scroll-proportion="0.0" vertical-offset="0" max-vertical-offset="599" /> <state line="0" column="0" selection-start="0" selection-end="0" vertical-scroll-proportion="0.0" vertical-offset="0" max-vertical-offset="599" />
</provider> </provider>
</entry> </entry>
<entry file="file://$PROJECT_DIR$/demos/default/protected/views/layouts/main.php">
<provider selected="true" editor-type-id="text-editor">
<state line="22" column="33" selection-start="1131" selection-end="1131" vertical-scroll-proportion="0.118673645" vertical-offset="306" max-vertical-offset="1105" />
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/www/protected/models/Programme.php"> <entry file="file://$PROJECT_DIR$/www/protected/models/Programme.php">
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state line="104" column="5" selection-start="3356" selection-end="3356" vertical-scroll-proportion="2.3053572" vertical-offset="477" max-vertical-offset="2567"> <state line="104" column="5" selection-start="3356" selection-end="3356" vertical-scroll-proportion="2.3053572" vertical-offset="477" max-vertical-offset="2567">
@ -886,13 +1086,6 @@
</state> </state>
</provider> </provider>
</entry> </entry>
<entry file="file://$PROJECT_DIR$/www/protected/components/UserIdentity.php">
<provider selected="true" editor-type-id="text-editor">
<state line="22" column="46" selection-start="673" selection-end="673" vertical-scroll-proportion="-11.576923" vertical-offset="73" max-vertical-offset="646">
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/framework/web/CController.php"> <entry file="file://$PROJECT_DIR$/framework/web/CController.php">
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state line="777" column="20" selection-start="29350" selection-end="29350" vertical-scroll-proportion="-0.2155797" vertical-offset="13209" max-vertical-offset="20910"> <state line="777" column="20" selection-start="29350" selection-end="29350" vertical-scroll-proportion="-0.2155797" vertical-offset="13209" max-vertical-offset="20910">
@ -900,45 +1093,15 @@
</state> </state>
</provider> </provider>
</entry> </entry>
<entry file="file://$PROJECT_DIR$/www/protected/views/site/about.php">
<provider selected="true" editor-type-id="text-editor">
<state line="29" column="36" selection-start="881" selection-end="881" vertical-scroll-proportion="17.846153" vertical-offset="957" max-vertical-offset="1530">
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/www/protected/views/layouts/main.php">
<provider selected="true" editor-type-id="text-editor">
<state line="44" column="85" selection-start="1413" selection-end="1413" vertical-scroll-proportion="-16.26923" vertical-offset="325" max-vertical-offset="1768">
<folding>
<marker date="1401259726860" expanded="true" signature="2456:2491" placeholder="..." />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/www/protected/components/SeededRandom.php"> <entry file="file://$PROJECT_DIR$/www/protected/components/SeededRandom.php">
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state line="35" column="27" selection-start="557" selection-end="557" vertical-scroll-proportion="-13.038462" vertical-offset="256" max-vertical-offset="850"> <state line="35" column="27" selection-start="557" selection-end="557" vertical-scroll-proportion="-13.038462" vertical-offset="256" max-vertical-offset="850">
<folding> <folding>
<element signature="e#6#84#0" expanded="true" /> <element signature="e#6#84#0" expanded="false" />
</folding> </folding>
</state> </state>
</provider> </provider>
</entry> </entry>
<entry file="file://$PROJECT_DIR$/www/protected/controllers/SiteController.php">
<provider selected="true" editor-type-id="text-editor">
<state line="10" column="58" selection-start="183" selection-end="183" vertical-scroll-proportion="-6.5384617" vertical-offset="0" max-vertical-offset="1173">
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/www/protected/config/main.php">
<provider selected="true" editor-type-id="text-editor">
<state line="67" column="24" selection-start="1393" selection-end="1393" vertical-scroll-proportion="-0.0" vertical-offset="1139" max-vertical-offset="1751">
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/www/protected/views/programme/index.php"> <entry file="file://$PROJECT_DIR$/www/protected/views/programme/index.php">
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state line="21" column="0" selection-start="382" selection-end="382" vertical-scroll-proportion="-9.807693" vertical-offset="102" max-vertical-offset="680"> <state line="21" column="0" selection-start="382" selection-end="382" vertical-scroll-proportion="-9.807693" vertical-offset="102" max-vertical-offset="680">
@ -946,25 +1109,102 @@
</state> </state>
</provider> </provider>
</entry> </entry>
<entry file="file://$PROJECT_DIR$/www/protected/views/site/index.php"> <entry file="file://$PROJECT_DIR$/www/protected/components/ProgrammeHelper.php">
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state line="19" column="23" selection-start="315" selection-end="315" vertical-scroll-proportion="-12.423077" vertical-offset="0" max-vertical-offset="1564"> <state line="36" column="95" selection-start="908" selection-end="908" vertical-scroll-proportion="0.19197208" vertical-offset="502" max-vertical-offset="1360">
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/www/protected/views/site/about.php">
<provider selected="true" editor-type-id="text-editor">
<state line="29" column="36" selection-start="881" selection-end="881" vertical-scroll-proportion="-0.80977315" vertical-offset="957" max-vertical-offset="1530">
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/demos/default/protected/controllers/SiteController.php">
<provider selected="true" editor-type-id="text-editor">
<state line="74" column="0" selection-start="1876" selection-end="2673" vertical-scroll-proportion="-2.6153846" vertical-offset="1190" max-vertical-offset="1938">
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/demos/default/protected/models/LoginForm.php">
<provider selected="true" editor-type-id="text-editor">
<state line="0" column="0" selection-start="0" selection-end="0" vertical-scroll-proportion="21.576923" vertical-offset="561" max-vertical-offset="1411">
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/www/protected/views/layouts/main.php">
<provider selected="true" editor-type-id="text-editor">
<state line="49" column="79" selection-start="1922" selection-end="1922" vertical-scroll-proportion="-8.423077" vertical-offset="614" max-vertical-offset="1785">
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/demos/default/protected/views/layouts/main.php">
<provider selected="true" editor-type-id="text-editor">
<state line="35" column="138" selection-start="1532" selection-end="1750" vertical-scroll-proportion="-11.115385" vertical-offset="306" max-vertical-offset="1105">
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/www/protected/controllers/SiteController.php">
<provider selected="true" editor-type-id="text-editor">
<state line="72" column="22" selection-start="1270" selection-end="1270" vertical-scroll-proportion="-4.3846154" vertical-offset="1110" max-vertical-offset="1734">
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/www/protected/models/LoginForm.php">
<provider selected="true" editor-type-id="text-editor">
<state line="0" column="0" selection-start="0" selection-end="0" vertical-scroll-proportion="25.5" vertical-offset="663" max-vertical-offset="1411">
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/www/protected/config/main.php">
<provider selected="true" editor-type-id="text-editor">
<state line="48" column="64" selection-start="1019" selection-end="1019" vertical-scroll-proportion="-11.115385" vertical-offset="527" max-vertical-offset="1751">
<folding> <folding>
<marker date="1401262284212" expanded="true" signature="824:847" placeholder="SELECT * FRO..programme..." /> <marker date="1401264485118" expanded="true" signature="333:2035" placeholder="..." />
<marker date="1401264485118" expanded="true" signature="946:1826" placeholder="..." />
<marker date="1401264485118" expanded="true" signature="972:1025" placeholder="..." />
</folding> </folding>
</state> </state>
</provider> </provider>
</entry> </entry>
<entry file="file://$PROJECT_DIR$/www/protected/controllers/ProgrammeController.php"> <entry file="file://$PROJECT_DIR$/www/protected/controllers/ProgrammeController.php">
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state line="130" column="0" selection-start="3238" selection-end="3238" vertical-scroll-proportion="-34.0" vertical-offset="1326" max-vertical-offset="3111"> <state line="42" column="14" selection-start="1098" selection-end="1098" vertical-scroll-proportion="-15.692307" vertical-offset="306" max-vertical-offset="3128">
<folding /> <folding />
</state> </state>
</provider> </provider>
</entry> </entry>
<entry file="file://$PROJECT_DIR$/www/protected/components/ProgrammeHelper.php"> <entry file="file://$PROJECT_DIR$/www/protected/components/UserIdentity.php">
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state line="36" column="95" selection-start="908" selection-end="908" vertical-scroll-proportion="0.19927536" vertical-offset="502" max-vertical-offset="1360"> <state line="26" column="27" selection-start="804" selection-end="804" vertical-scroll-proportion="-11.807693" vertical-offset="135" max-vertical-offset="714">
<folding>
<marker date="1401266225595" expanded="true" signature="646:705" placeholder="SELECT SValu..othervalues..." />
<marker date="1401266225595" expanded="true" signature="652:705" placeholder="select SValu..othervalues..." />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/www/protected/views/site/index.php">
<provider selected="true" editor-type-id="text-editor">
<state line="45" column="42" selection-start="748" selection-end="1003" vertical-scroll-proportion="-11.769231" vertical-offset="459" max-vertical-offset="1564">
<folding>
<marker date="1401262284212" expanded="true" signature="824:847" placeholder="SELECT * FRO..programme..." />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/www/protected/views/site/login.php">
<provider selected="true" editor-type-id="text-editor">
<state line="37" column="59" selection-start="956" selection-end="956" vertical-scroll-proportion="0.5284974" vertical-offset="323" max-vertical-offset="1020">
<folding /> <folding />
</state> </state>
</provider> </provider>

View File

@ -17,10 +17,14 @@ class UserIdentity extends CUserIdentity
*/ */
public function authenticate() public function authenticate()
{ {
$connection = Yii::app()->db;
$command=$connection->createCommand("SELECT SValue FROM othervalues WHERE Name = 'AdminPassword'");
$pw = $command->queryScalar();
$users=array( $users=array(
// username => password // username => password
'demo'=>'demo', 'admin' => $pw,
'admin'=>'admin', //TODO Change me
); );
if(!isset($users[$this->username])) if(!isset($users[$this->username]))
$this->errorCode=self::ERROR_USERNAME_INVALID; $this->errorCode=self::ERROR_USERNAME_INVALID;

View File

@ -27,20 +27,20 @@ class ProgrammeController extends Controller
{ {
return array( return array(
array('allow', // allow all users to perform 'index' and 'view' actions array('allow', // allow all users to perform 'index' and 'view' actions
'actions'=>array('index','view','create','update','admin','delete'), 'actions'=>array('index','view'),
'users'=>array('*'), 'users'=>array('*'),
), ),
// array('allow', // allow authenticated user to perform 'create' and 'update' actions array('allow', // allow authenticated user to perform 'create' and 'update' actions
// 'actions'=>array('create','update'), 'actions'=>array('create','update','admin','delete'),
// 'users'=>array('@'), 'users'=>array('@'),
// ), ),
// array('allow', // allow admin user to perform 'admin' and 'delete' actions // array('allow', // allow admin user to perform 'admin' and 'delete' actions
// 'actions'=>array('admin','delete'), // 'actions'=>array(),
// 'users'=>array('admin'), // 'users'=>array('admin'),
// ), // ),
// array('deny', // deny all users array('deny', // deny everythign else to all users
// 'users'=>array('*'), 'users'=>array('*'),
// ), ),
); );
} }
@ -106,6 +106,7 @@ class ProgrammeController extends Controller
* Deletes a particular model. * Deletes a particular model.
* If deletion is successful, the browser will be redirected to the 'admin' page. * If deletion is successful, the browser will be redirected to the 'admin' page.
* @param integer $id the ID of the model to be deleted * @param integer $id the ID of the model to be deleted
* @throws CHttpException on invalid request
*/ */
public function actionDelete($id) public function actionDelete($id)
{ {

View File

@ -57,8 +57,41 @@ class SiteController extends Controller
$data['model'] = new SendMailForm(); $data['model'] = new SendMailForm();
} }
$this->render('about', $data); $this->render('about', $data);
} }
/**
* Displays the login page
*/
public function actionLogin()
{
$model=new LoginForm;
// if it is ajax validation request
if(isset($_POST['ajax']) && $_POST['ajax']==='login-form')
{
echo TbActiveForm::validate($model);
Yii::app()->end();
}
// collect user input data
if(isset($_POST['LoginForm']))
{
$model->attributes=$_POST['LoginForm'];
// validate user input and redirect to the previous page if valid
if($model->validate() && $model->login())
$this->redirect(Yii::app()->user->returnUrl);
}
// display the login form
$this->render('login', array('model'=>$model));
}
/**
* Logs out the current user and redirect to homepage.
*/
public function actionLogout()
{
Yii::app()->user->logout();
$this->redirect(Yii::app()->homeUrl);
}
} }

View File

@ -0,0 +1,77 @@
<?php
/**
* LoginForm class.
* LoginForm is the data structure for keeping
* user login form data. It is used by the 'login' action of 'SiteController'.
*/
class LoginForm extends CFormModel
{
public $username;
public $password;
public $rememberMe;
private $_identity;
/**
* Declares the validation rules.
* The rules state that username and password are required,
* and password needs to be authenticated.
*/
public function rules()
{
return array(
// username and password are required
array('username, password', 'required'),
// rememberMe needs to be a boolean
array('rememberMe', 'boolean'),
// password needs to be authenticated
array('password', 'authenticate'),
);
}
/**
* Declares attribute labels.
*/
public function attributeLabels()
{
return array(
'rememberMe'=>'Remember me next time',
);
}
/**
* Authenticates the password.
* This is the 'authenticate' validator as declared in rules().
*/
public function authenticate($attribute,$params)
{
if(!$this->hasErrors())
{
$this->_identity=new UserIdentity($this->username,$this->password);
if(!$this->_identity->authenticate())
$this->addError('password','Incorrect username or password.');
}
}
/**
* Logs in the user using the given username and password in the model.
* @return boolean whether login is successful
*/
public function login()
{
if($this->_identity===null)
{
$this->_identity=new UserIdentity($this->username,$this->password);
$this->_identity->authenticate();
}
if($this->_identity->errorCode===UserIdentity::ERROR_NONE)
{
$duration=$this->rememberMe ? 3600*24*30 : 0; // 30 days
Yii::app()->user->login($this->_identity,$duration);
return true;
}
else
return false;
}
}

View File

@ -47,6 +47,7 @@
['label' => 'Programme', 'url' => '/programme/', 'active' => ($this->selectedNav === 'prog')], ['label' => 'Programme', 'url' => '/programme/', 'active' => ($this->selectedNav === 'prog')],
['label' => '', 'items' => ProgrammeHelper::GetProgDropDownList(), 'htmlOptions' => ['class' => 'dropdown-append']], ['label' => '', 'items' => ProgrammeHelper::GetProgDropDownList(), 'htmlOptions' => ['class' => 'dropdown-append']],
['label' => 'About', 'url' => '/about', 'active' => ($this->selectedNav === 'about')], ['label' => 'About', 'url' => '/about', 'active' => ($this->selectedNav === 'about')],
['label' => '[[Log "'.Yii::app()->user->name.'" out]]', 'url' => '/logout', 'visible' => !Yii::app()->user->isGuest]
], ],
], ],
TbHtml::navbarSearchForm('search', '', TbHtml::navbarSearchForm('search', '',

View File

@ -0,0 +1,55 @@
<?php
/* @var $this SiteController */
/* @var $model LoginForm */
/* @var $form CActiveForm */
$this->pageTitle = Yii::app()->name . ' - Login';
$this->breadcrumbs = array(
'Login',
);
?>
<div class="container well">
<h1>Login</h1>
<p>Please fill out the following form with your login credentials:</p>
<div class="form">
<?php $form = $this->beginWidget('TbActiveForm', array(
'id' => 'login-form',
'enableClientValidation' => true,
'clientOptions' => array(
'validateOnSubmit' => true,
),
)); ?>
<p class="note">Fields with <span class="required">*</span> are required.</p>
<div>
<?php echo $form->labelEx($model, 'username'); ?>
<?php echo $form->textField($model, 'username'); ?>
<?php echo $form->error($model, 'username'); ?>
</div>
<div>
<?php echo $form->labelEx($model, 'password'); ?>
<?php echo $form->passwordField($model, 'password'); ?>
<?php echo $form->error($model, 'password'); ?>
</div>
<div class="rememberMe">
<?php echo $form->checkBox($model, 'rememberMe'); ?>
<?php echo $form->label($model, 'rememberMe'); ?>
<?php echo $form->error($model, 'rememberMe'); ?>
</div>
<div class="buttons">
<?php echo TbHtml::submitButton('Login'); ?>
</div>
<?php $this->endWidget(); ?>
</div>
<!-- form -->
</div><!-- Container -->