-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Current Media Upload Feature - Copyright Notice
- Loading branch information
Showing
14 changed files
with
377 additions
and
155 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,120 @@ | ||
<?php | ||
/** | ||
* Open Labyrinth [ http://www.openlabyrinth.ca ] | ||
* | ||
* Open Labyrinth is free software: you can redistribute it and/or modify | ||
* it under the terms of the GNU General Public License as published by | ||
* the Free Software Foundation, either version 3 of the License, or | ||
* (at your option) any later version. | ||
* | ||
* Open Labyrinth is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU General Public License | ||
* along with Open Labyrinth. If not, see <http://www.gnu.org/licenses/>. | ||
* | ||
* @copyright Copyright 2012 Open Labyrinth. All Rights Reserved. | ||
* | ||
*/ | ||
defined('SYSPATH') or die('No direct script access.'); | ||
|
||
class Controller_SystemManager extends Controller_Base { | ||
|
||
public function before() { | ||
parent::before(); | ||
|
||
if(Auth::instance()->get_user()->type->name != 'superuser') { | ||
Request::initial()->redirect(URL::base()); | ||
} | ||
|
||
unset($this->templateData['right']); | ||
$this->template->set('templateData', $this->templateData); | ||
} | ||
|
||
public function action_index(){ | ||
$this->templateData['token'] = Security::token(); | ||
$this->templateData['email_config'] = Kohana::$config->load('email'); | ||
$viewPasswordReset = View::factory('systemmanager/passwordReset'); | ||
$viewPasswordReset->set('templateData', $this->templateData); | ||
$this->templateData['tabsName'][0] = __('Password recovery settings'); | ||
$this->templateData['tabs'][0] = $viewPasswordReset; | ||
|
||
$this->templateData['media_copyright'] = Kohana::$config->load('media_upload_copyright'); | ||
$viewCopyright = View::factory('systemmanager/mediaUploadCopyright'); | ||
$viewCopyright->set('templateData', $this->templateData); | ||
$this->templateData['tabsName'][1] = __('Media Upload - Copyright Notice'); | ||
$this->templateData['tabs'][1] = $viewCopyright; | ||
|
||
$view = View::factory('systemmanager/view'); | ||
$view->set('templateData', $this->templateData); | ||
|
||
$this->templateData['center'] = $view; | ||
$this->template->set('templateData', $this->templateData); | ||
} | ||
|
||
public function action_updatePasswordResetSettings(){ | ||
if ($_POST){ | ||
if (Security::check($_POST['token'])){ | ||
unset($_POST['token']); | ||
$string = 'return array ('; | ||
foreach($_POST as $key => $value){ | ||
$value = str_replace('"', '\"', $value); | ||
$string .= '"'.$key.'" => "'.$value.'", '; | ||
} | ||
$string .= ');'; | ||
|
||
$content = ''; | ||
$handle = fopen(DOCROOT.'application/config/email.php', 'r'); | ||
while (($buffer = fgets($handle)) !== false) { | ||
$content .= $buffer; | ||
} | ||
|
||
$position = strpos($content, 'return array'); | ||
$header = substr($content, 0, $position); | ||
|
||
file_put_contents(DOCROOT.'application/config/email.php', $header.$string); | ||
|
||
Request::initial()->redirect(URL::base().'systemManager'); | ||
}else{ | ||
Request::initial()->redirect(URL::base()); | ||
} | ||
}else{ | ||
Request::initial()->redirect(URL::base()); | ||
} | ||
} | ||
|
||
public function action_updateMediaUploadCopyright(){ | ||
if ($_POST){ | ||
if (Security::check($_POST['token'])){ | ||
unset($_POST['token']); | ||
$string = 'return array ('; | ||
foreach($_POST as $key => $value){ | ||
$value = str_replace('"', '\"', $value); | ||
$string .= '"'.$key.'" => "'.$value.'", '; | ||
} | ||
$string .= ');'; | ||
|
||
$content = ''; | ||
$handle = fopen(DOCROOT.'application/config/media_upload_copyright.php', 'r'); | ||
while (($buffer = fgets($handle)) !== false) { | ||
$content .= $buffer; | ||
} | ||
|
||
$position = strpos($content, 'return array'); | ||
$header = substr($content, 0, $position); | ||
|
||
file_put_contents(DOCROOT.'application/config/media_upload_copyright.php', $header.$string); | ||
|
||
Request::initial()->redirect(URL::base().'systemManager#tabs-1'); | ||
}else{ | ||
Request::initial()->redirect(URL::base()); | ||
} | ||
}else{ | ||
Request::initial()->redirect(URL::base()); | ||
} | ||
} | ||
} | ||
|
||
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
<?php | ||
/** | ||
* Open Labyrinth [ http://www.openlabyrinth.ca ] | ||
* | ||
* Open Labyrinth is free software: you can redistribute it and/or modify | ||
* it under the terms of the GNU General Public License as published by | ||
* the Free Software Foundation, either version 3 of the License, or | ||
* (at your option) any later version. | ||
* | ||
* Open Labyrinth is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU General Public License | ||
* along with Open Labyrinth. If not, see <http://www.gnu.org/licenses/>. | ||
* | ||
* @copyright Copyright 2012 Open Labyrinth. All Rights Reserved. | ||
* | ||
*/ | ||
defined('SYSPATH') or die('No direct access allowed.'); | ||
|
||
return array ("title" => "General statement", "copyright_message" => "I acknowledge that I own the copyright to the digital media I upload, or that I have obtained the written permission of the copyright owner, or am using an digital media with an appropriate Creative Commons license.", ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
49 changes: 49 additions & 0 deletions
49
www/application/views/systemmanager/mediaUploadCopyright.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
<?php | ||
/** | ||
* Open Labyrinth [ http://www.openlabyrinth.ca ] | ||
* | ||
* Open Labyrinth is free software: you can redistribute it and/or modify | ||
* it under the terms of the GNU General Public License as published by | ||
* the Free Software Foundation, either version 3 of the License, or | ||
* (at your option) any later version. | ||
* | ||
* Open Labyrinth is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU General Public License | ||
* along with Open Labyrinth. If not, see <http://www.gnu.org/licenses/>. | ||
* | ||
* @copyright Copyright 2012 Open Labyrinth. All Rights Reserved. | ||
* | ||
*/ | ||
?> | ||
<form action="<?php echo URL::base().'systemManager/updateMediaUploadCopyright/'; ?>" method="post"> | ||
<table> | ||
<tr> | ||
<td align="left"> | ||
<p><?php echo __('Title: '); ?></p> | ||
</td> | ||
<td align="left"> | ||
<p><input size="50" type="text" name="title" value="<?php echo $templateData['media_copyright']['title']; ?>" /></p> | ||
</td> | ||
</tr> | ||
<tr> | ||
<td align="left"> | ||
<p><?php echo __('Copyright message: '); ?></p> | ||
</td> | ||
<td align="left"> | ||
<p> | ||
<textarea style="width:320px; height:130px;" name="copyright_message"><?php echo $templateData['media_copyright']['copyright_message']; ?></textarea> | ||
</p> | ||
</td> | ||
</tr> | ||
<tr> | ||
<td colspan="2" align="left"> | ||
<input type="Submit" value="<?php echo __('Submit'); ?>"> | ||
</td> | ||
</tr> | ||
</table> | ||
<input type="hidden" name="token" value="<?php echo $templateData['token']; ?>" /> | ||
</form> |
Oops, something went wrong.