move code up one directory
[atutor.git] / mods / _standard / photos / admin / preferences.php
1 <?php
2 /***********************************************************************/
3 /* ATutor                                                                                                                          */
4 /***********************************************************************/
5 /* Copyright (c) 2002-2010                                             */
6 /* Inclusive Design Institute                                          */
7 /* http://atutor.ca                                                                                                        */
8 /*                                                                                                                                         */
9 /* This program is free software. You can redistribute it and/or           */
10 /* modify it under the terms of the GNU General Public License             */
11 /* as published by the Free Software Foundation.                                           */
12 /***********************************************************************/
13 // $Id$
14 define('AT_INCLUDE_PATH', '../../../../include/');
15 require (AT_INCLUDE_PATH.'vitals.inc.php');
16
17 //save config files.
18 if(isset($_POST['submit'])){
19         $max_memory = intval($_POST['pa_max_memory']);
20         if ($max_memory <= 0){
21                 $msg->addError('PA_MEMORY_INPUT_ERROR');
22         } else {
23                 $sql = 'UPDATE '.TABLE_PREFIX."config SET value='$max_memory' WHERE name='pa_max_memory_per_member'";
24                 $result = mysql_query($sql, $db);
25                 if ($reuslt===false){
26                         $msg->addError('PA_MEMORY_SQL_ERROR');
27                 } else {
28                         $msg->addFeedback('ACTION_COMPLETED_SUCCESSFULLY');
29                         header('Location: preferences.php');
30                         exit;
31                 }
32         }
33 }
34
35 require (AT_INCLUDE_PATH.'header.inc.php');
36 $savant->assign('max_memory', $_config['pa_max_memory_per_member']);
37 $savant->display('photos/admin/pa_preferences.tmpl.php');
38 require (AT_INCLUDE_PATH.'footer.inc.php');
39 ?>