Umfragen
edit.poll.handle.php
Go to the documentation of this file.
1 <?php
2 /*
3  * edit.poll.handle.php
4  *
5  * Copyright 2012 Johannes <jojo@jojo-42>
6  *
7  * This program is free software; you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License as published by
9  * the Free Software Foundation; either version 2 of the License, or
10  * (at your option) any later version.
11  *
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with this program; if not, write to the Free Software
19  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
20  * MA 02110-1301, USA.
21  *
22  *
23  */
24 
25 require_once("../inc/auth.class.php");
26 require_once("../config.php");
27 //$au = new LDAPauth(LDAP_HOST , LDAP_PORT , LDAP_ROOTDN);
29 
30 $all_err_reason = array();
31 
32 
33 // POLL NAME
34 $err = $poll->handle_name_edit();
35 if ($err === true){
36  $poll->save_name($db);
37 }else{
39 }
40 
41 
42 // POLL GROUPS
43 $poll_groups_before= $poll->groups;
44 $err = $poll->handle_groups_edit($au,$groups_whitelist);
45 $poll_groups_after = $poll->groups;
46 // if groups not have changed, do nothing (klassenliste is a veeeery heavy duty)
47 if ( $err === true ){
48  if ($poll_groups_after != $poll_groups_before){
49  $poll->save_groups($db);
50  $users_in_teacher_group = $au->get_all_users_from_grouplist( explode(",",TEACHER_GROUP) );
51  foreach($users_in_teacher_group as $u){
52  if($poll->owner == $u["userID"]){
53  $db->klassenliste($au,$poll);
54  break;
55  }
56  }
57  }
58 }else{
60 }
61 
62 // POLL TIMEOUT
63 $err = $poll->handle_timeout_edit();
64 if ($err === true){
65  $poll->save_timeout($db);
66 }else{
68 }
69 
70 // POLL STATUS
71 $err = $poll->handle_status_edit($db);
72 if ($err !== true){
74 }
75 
76 // POLL FONT
77 $poll->handle_font_family_edit();
78 $poll->handle_font_size_edit();
79 $poll->handle_questions_bold_edit();
80 foreach( $poll->widget_list as $widget ){
81  $widget->save_config($db);
82 }
83 
84 // POLL THEME
85 $err = $poll->handle_theme_edit();
86 if ($err !== true){
88 }else{
89  $poll->save_theme($db);
90 }
91 
92 // anonymous
93 $err = $poll->handle_anonymous2_edit($db,$au);
94 if ($err !== true){
95  $all_err_reason[] = $err[0];
96  $all_err_reason[] = $err[1];
97 }
98 
99 $poll->handle_noDisplay_edit();
100 $poll->save_noDisplay($db);
101 
102 // notifications
103 $poll->handle_notification_edit();
104 $poll->save_config($db);
105 ?>