Changeset 1085
- Timestamp:
- 08/31/06 07:31:33 (7 years ago)
- Location:
- trunk/wifidog-auth
- Files:
-
- 7 modified
-
CHANGELOG (modified) (1 diff)
-
wifidog/classes/Content.php (modified) (14 diffs)
-
wifidog/classes/Content/ContentGroup/ContentGroup.php (modified) (49 diffs)
-
wifidog/classes/Network.php (modified) (3 diffs)
-
wifidog/classes/Server.php (modified) (1 diff)
-
wifidog/include/schema_validate.php (modified) (2 diffs)
-
wifidog/media/base_theme/stylesheet.css (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/wifidog-auth/CHANGELOG
r1084 r1085 1 2006-08-31 Benoit Grégoire <bock@step.polymtl.ca> 2 * Server.php: Make sure getCurrentServer returns the default server if the hostname isn't recognised. 3 * Content manager: 4 -Allow deleting simple (trivial) but persistent content 5 -Remove the sponsor info field from Content Metadata. Best practices is now to use the project info field to show this information. 6 * Add the necessary schema constraints to allow manually deleting networks, nodes and users. Be carefull, removing any of theses will remove all traces of connection statistics as well. You've been warned. 7 * Do not display the network in the login interface if there is only one. 8 * Add a pseudo-random content ordering mode. Pick content elements randomly, but do not display the same content twice untill all content has been seen. 9 * Allow setting a title but not displaying it (very usefull for reusable content) 10 1 11 2006-08-29 Max Horváth <max.horvath@maxspot.de> 2 12 * Cleaned up PHPdoc tags -
trunk/wifidog-auth/wifidog/classes/Content.php
r1081 r1085 874 874 } 875 875 876 /**877 * Get content sponsor info878 * @return content a content sub-class879 */880 public function getSponsorInfo() {881 try {882 return self :: getObject($this->content_row['sponsor_info']);883 } catch (Exception $e) {884 return null;885 }886 }887 888 876 /** Set the object type of this object 889 877 * Note that after using this, the object must be re-instanciated to have the right type … … 1040 1028 $html .= "<div class='user_ui_main_inner'>\n"; 1041 1029 1042 if (!empty ($this->content_row['title']) ) {1030 if (!empty ($this->content_row['title']) && $this->titleShouldDisplay()) { 1043 1031 $html .= "<div class='user_ui_title'>\n"; 1044 1032 $title = self :: getObject($this->content_row['title']); … … 1076 1064 } 1077 1065 1078 if (!empty ($this->content_row['project_info']) || !empty ($this->content_row['sponsor_info'])) {1066 if (!empty ($this->content_row['project_info']) ) { 1079 1067 if (!empty ($this->content_row['project_info'])) { 1080 1068 $html .= "<div class='user_ui_projet_info'>\n"; … … 1086 1074 $project_info->setLoggingStatus(false); 1087 1075 $html .= $project_info->getUserUI(); 1088 $html .= "</div>\n";1089 }1090 1091 if (!empty ($this->content_row['sponsor_info'])) {1092 $html .= "<div class='user_ui_sponsor_info'>\n";1093 $html .= "<b>"._("Project sponsor:")."</b>";1094 $sponsor_info = self :: getObject($this->content_row['sponsor_info']);1095 $sponsor_info->setLogAsContent($this);1096 // If the content logging is disabled, all the children will inherit this property temporarly1097 if ($this->getLoggingStatus() == false)1098 $sponsor_info->setLoggingStatus(false);1099 $html .= $sponsor_info->getUserUI();1100 1076 $html .= "</div>\n"; 1101 1077 } … … 1194 1170 $html .= FormSelectGenerator :: generateFromArray($tab, null, "content_".$this->id."_content_type", "Content", false); 1195 1171 } else { 1172 // Content metadata 1196 1173 if ($this->is_trivial_content == false) { 1197 1174 $html .= "<fieldset class='admin_element_group'>\n"; 1198 1175 $html .= "<legend>".sprintf(_("%s MetaData"),get_class($this))."</legend>\n"; 1199 1176 1177 /* title_is_displayed */ 1178 $html_title_is_displayed = _("Display the title?").": \n"; 1179 $name = "content_".$this->id."_title_is_displayed"; 1180 $this->titleShouldDisplay() ? $checked = 'CHECKED' : $checked = ''; 1181 $html_title_is_displayed .= "<input type='checkbox' name='$name' $checked>\n"; 1182 1200 1183 /* title */ 1201 1184 $html .= "<li class='admin_element_item_container admin_section_edit_title'>\n"; 1202 $html .= "<div class='admin_element_data'>\n"; 1185 $html .= "<div class='admin_element_data'>\n"; 1203 1186 if (empty ($this->content_row['title'])) { 1204 $html .= self :: getNewContentUI("title_{$this->id}_new", null, _("Title:")); 1187 $html .= self :: getNewContentUI("title_{$this->id}_new", null, _("Title:")); 1205 1188 $html .= "</div>\n"; 1206 1189 } else { 1190 $html .= $html_title_is_displayed; 1207 1191 $title = self :: getObject($this->content_row['title']); 1208 1192 $html .= $title->getAdminUI(null, _("Title:")); … … 1214 1198 } 1215 1199 $html .= "</li>\n"; 1216 1217 1218 1200 1219 1201 /* description */ … … 1267 1249 } 1268 1250 $html .= "</li>\n"; 1269 1270 /* sponsor_info */ 1271 $html .= "<li class='admin_element_item_container admin_section_edit_sponsor'>\n"; 1272 $html .= "<div class='admin_element_data'>\n"; 1273 if (empty ($this->content_row['sponsor_info'])) { 1274 $html .= self :: getNewContentUI("sponsor_info_{$this->id}_new", null, _("Sponsor of this project:")); 1275 $html .= "</div>\n"; 1276 } else { 1277 $sponsor_info = self :: getObject($this->content_row['sponsor_info']); 1278 $html .= $sponsor_info->getAdminUI(null, _("Sponsor of this project:")); 1279 $html .= "</div>\n"; 1280 $html .= "<div class='admin_element_tools'>\n"; 1281 $name = "content_".$this->id."_sponsor_info_erase"; 1282 $html .= "<input type='submit' class='submit' name='$name' value='".sprintf(_("Delete %s (%s)"),_("sponsor"),get_class($sponsor_info))."'>"; 1283 $html .= "</div>\n"; 1284 } 1285 $html .= "</li>\n"; 1286 $html .= "</fieldset>\n"; 1287 1288 $html .= "<fieldset class='admin_element_group'>\n"; 1251 }//End content medatada 1252 1253 if ($this->is_trivial_content == false || $this->isPersistent()) { 1254 $html .= "<fieldset class='admin_element_group'>\n"; 1289 1255 $html .= "<legend>".sprintf(_("%s access control"),get_class($this))."</legend>\n"; 1290 1256 … … 1295 1261 $name = "content_".$this->id."_is_persistent"; 1296 1262 $this->isPersistent() ? $checked = 'CHECKED' : $checked = ''; 1297 $html .= "<input type='checkbox' name='$name' $checked >\n";1263 $html .= "<input type='checkbox' name='$name' $checked onChange='submit();'>\n"; 1298 1264 $html .= "</div>\n"; 1299 1265 $html .= "</li>\n"; … … 1338 1304 $html .= "</li>\n"; 1339 1305 $html .= "</fieldset>\n"; 1340 }//End if is trivial content 1306 1307 } 1341 1308 } 1342 1309 $html .= $subclass_admin_interface; … … 1355 1322 $this->setContentType($content_type); 1356 1323 } else 1324 {//Content medatada 1325 /* title_is_displayed */ 1326 if (!empty ($this->content_row['title'])){ 1327 $name = "content_".$this->id."_title_is_displayed"; 1328 !empty ($_REQUEST[$name]) ? $this->setTitleIsDisplayed(true) : $this->setTitleIsDisplayed(false); 1329 } 1330 1357 1331 if ($this->is_trivial_content == false) { 1358 1332 /* title */ … … 1427 1401 } 1428 1402 } 1429 1430 /* sponsor_info */ 1431 if (empty ($this->content_row['sponsor_info'])) { 1432 $sponsor_info = self :: processNewContentUI("sponsor_info_{$this->id}_new"); 1433 if ($sponsor_info != null) { 1434 $sponsor_info_id = $sponsor_info->GetId(); 1435 $db->execSqlUpdate("UPDATE content SET sponsor_info = '$sponsor_info_id' WHERE content_id = '$this->id'", FALSE); 1436 } 1437 } else { 1438 $sponsor_info = self :: getObject($this->content_row['sponsor_info']); 1439 $name = "content_".$this->id."_sponsor_info_erase"; 1440 if (!empty ($_REQUEST[$name]) && $_REQUEST[$name] == true) { 1441 $db->execSqlUpdate("UPDATE content SET sponsor_info = NULL WHERE content_id = '$this->id'", FALSE); 1442 $sponsor_info->delete($errmsg); 1443 } else { 1444 $sponsor_info->processAdminUI(); 1445 } 1446 } 1447 1403 }//End content metadata 1404 1405 if ($this->is_trivial_content == false || $this->isPersistent()) { 1448 1406 /* is_persistent */ 1449 1407 $name = "content_".$this->id."_is_persistent"; … … 1482 1440 $this->addOwner($user); 1483 1441 } 1484 1442 } 1485 1443 } 1486 1444 $this->refresh(); … … 1513 1471 public function unsubscribe(User $user) { 1514 1472 return $user->removeContent($this); 1473 } 1474 1475 /** If the title is not empty, should it be displayed? 1476 * @return true or false */ 1477 public function titleShouldDisplay() { 1478 if ($this->content_row['title_is_displayed'] == 't') { 1479 $retval = true; 1480 } else { 1481 $retval = false; 1482 } 1483 return $retval; 1484 } 1485 1486 /** If the title is not empty, should it be displayed? 1487 * @param $should_display true or false 1488 * */ 1489 public function setTitleIsDisplayed($should_display) { 1490 if ($should_display != $this->titleShouldDisplay()) /* Only update database if there is an actual change */ { 1491 $should_display ? $should_display_sql = 'TRUE' : $should_display_sql = 'FALSE'; 1492 global $db; 1493 $db->execSqlUpdate("UPDATE content SET title_is_displayed = $should_display_sql WHERE content_id = '$this->id'", false); 1494 $this->refresh(); 1495 } 1496 1515 1497 } 1516 1498 … … 1525 1507 return $retval; 1526 1508 } 1527 1509 1528 1510 /** Set if the content group is persistent 1529 1511 * @param $is_locative_content true or false -
trunk/wifidog-auth/wifidog/classes/Content/ContentGroup/ContentGroup.php
r1070 r1085 1 1 <?php 2 2 3 3 4 /* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */ … … 46 47 * Load ContentGroupElement class 47 48 */ 48 require_once ('classes/Content/ContentGroup/ContentGroupElement.php');49 require_once ('classes/Content/ContentGroup/ContentGroupElement.php'); 49 50 50 51 /** … … 56 57 * @copyright 2005-2006 Benoit Grégoire, Technologies Coeus inc. 57 58 */ 58 class ContentGroup extends Content 59 { 60 61 private $CONTENT_ORDERING_MODES = array ('RANDOM' => "Pick content elements randomly", 'SEQUENTIAL' => "Pick content elements in sequential order"); 62 private $CONTENT_CHANGES_ON_MODES = array ('ALWAYS' => "Content always rotates", 'NEXT_DAY' => "Content rotates once per day", 'NEXT_LOGIN' => "Content rotates once per session", 'NEXT_NODE' => "Content rotates each time you change node"); 63 private $ALLOW_REPEAT_MODES = array ('YES' => "Content can be shown more than once", 'NO' => "Content can only be shown once", 'ONCE_PER_NODE' => "Content can be shown more than once, but not at the same node"); 59 class ContentGroup extends Content { 60 61 private $CONTENT_ORDERING_MODES = array ( 62 'RANDOM' => "Pick content elements randomly", 63 'PSEUDO_RANDOM' => "Pick content elements randomly, but do not display the same content twice untill all content has been seen", 64 'SEQUENTIAL' => "Pick content elements in sequential order" 65 ); 66 private $CONTENT_CHANGES_ON_MODES = array ( 67 'ALWAYS' => "Content always rotates", 68 'NEXT_DAY' => "Content rotates once per day", 69 'NEXT_LOGIN' => "Content rotates once per session", 70 'NEXT_NODE' => "Content rotates each time you change node" 71 ); 72 private $ALLOW_REPEAT_MODES = array ( 73 'YES' => "Content can be shown more than once", 74 'NO' => "Content can only be shown once", 75 'ONCE_PER_NODE' => "Content can be shown more than once, but not at the same node" 76 ); 64 77 65 78 protected $is_artistic_content; … … 75 88 private $content_group_row; 76 89 77 protected function __construct($content_id) 78 { 90 protected function __construct($content_id) { 79 91 // Define globals 80 92 global $db; … … 89 101 $sql = "SELECT * FROM content_group WHERE content_group_id='$content_id'"; 90 102 $db->execSqlUniqueRes($sql, $row, false); 91 if ($row == null) 92 { 103 if ($row == null) { 93 104 /*Since the parent Content exists, the necessary data in content_group had not yet been created */ 94 105 $sql = "INSERT INTO content_group (content_group_id) VALUES ('$content_id')"; … … 96 107 $sql = "SELECT * FROM content_group WHERE content_group_id='$content_id'"; 97 108 $db->execSqlUniqueRes($sql, $row, false); 98 if ($row == null) 99 { 100 throw new Exception(_("The content with the following id could not be found in the database: ").$content_id); 109 if ($row == null) { 110 throw new Exception(_("The content with the following id could not be found in the database: ") . $content_id); 101 111 } 102 112 … … 111 121 /** Is the content group artistic in nature? 112 122 * @return true or false */ 113 public function isArtisticContent() 114 { 115 if ($this->content_group_row['is_artistic_content'] == 't') 116 { 117 $retval = true; 118 } 119 else 120 { 123 public function isArtisticContent() { 124 if ($this->content_group_row['is_artistic_content'] == 't') { 125 $retval = true; 126 } else { 121 127 $retval = false; 122 128 } … … 126 132 /** Set if the content group is artistic in nature, 127 133 * @param $is_artistic_content true or false*/ 128 public function setIsArtisticContent($is_artistic_content) 129 { 130 if ($is_artistic_content != $this->isArtisticContent()) /* Only update database if there is an actual change */ 131 { 134 public function setIsArtisticContent($is_artistic_content) { 135 if ($is_artistic_content != $this->isArtisticContent()) /* Only update database if there is an actual change */ { 132 136 $is_artistic_content ? $is_artistic_content_sql = 'TRUE' : $is_artistic_content_sql = 'FALSE'; 133 137 … … 141 145 /** Does the content shown or generated by the content group directly related to where it is viewed from? 142 146 * @return true or false */ 143 public function isLocativeContent() 144 { 145 if ($this->content_group_row['is_locative_content'] == 't') 146 { 147 $retval = true; 148 } 149 else 150 { 147 public function isLocativeContent() { 148 if ($this->content_group_row['is_locative_content'] == 't') { 149 $retval = true; 150 } else { 151 151 $retval = false; 152 152 } … … 157 157 * @param $is_locative_content true or false 158 158 * */ 159 public function setIsLocativeContent($is_locative_content) 160 { 161 if ($is_locative_content != $this->isLocativeContent()) /* Only update database if there is an actual change */ 162 { 159 public function setIsLocativeContent($is_locative_content) { 160 if ($is_locative_content != $this->isLocativeContent()) /* Only update database if there is an actual change */ { 163 161 $is_locative_content ? $is_locative_content_sql = 'TRUE' : $is_locative_content_sql = 'FALSE'; 164 162 … … 172 170 /** In what order is the content displayed to the user 173 171 * @return string, a key of CONTENT_SELECTION_MODES */ 174 public function getContentOrderingMode() 175 { 172 public function getContentOrderingMode() { 176 173 return $this->content_group_row['content_ordering_mode']; 177 174 } … … 181 178 * @return true if successfull 182 179 * */ 183 protected function setContentOrderingMode($content_ordering_mode, & $errormsg = null) 184 { 180 protected function setContentOrderingMode($content_ordering_mode, & $errormsg = null) { 185 181 $retval = false; 186 if (isset ($this->CONTENT_ORDERING_MODES[$content_ordering_mode]) && $content_ordering_mode != $this->getContentOrderingMode()) /* Only update database if the mode is valid and there is an actual change */ 187 { 182 if (isset ($this->CONTENT_ORDERING_MODES[$content_ordering_mode]) && $content_ordering_mode != $this->getContentOrderingMode()) /* Only update database if the mode is valid and there is an actual change */ { 188 183 global $db; 189 184 $content_ordering_mode = $db->escapeString($content_ordering_mode); … … 192 187 $retval = true; 193 188 } 194 elseif (!isset ($this->CONTENT_ORDERING_MODES[$content_ordering_mode])) 195 { 189 elseif (!isset ($this->CONTENT_ORDERING_MODES[$content_ordering_mode])) { 196 190 $errormsg = _("Invalid content selection mode (must be part of CONTENT_ORDERING_MODES)"); 197 191 $retval = false; 198 } 199 else 200 { 192 } else { 201 193 /* Successfull, but nothing modified */ 202 194 $retval = true; … … 207 199 /** When does the content rotate? 208 200 * @return string, a key of CONTENT_SELECTION_MODES */ 209 public function getContentChangesOnMode() 210 { 201 public function getContentChangesOnMode() { 211 202 return $this->content_group_row['content_changes_on_mode']; 212 203 } … … 216 207 * @return true if successfull 217 208 * */ 218 protected function setContentChangesOnMode($content_changes_on_mode, & $errormsg = null) 219 { 209 protected function setContentChangesOnMode($content_changes_on_mode, & $errormsg = null) { 220 210 $retval = false; 221 if (isset ($this->CONTENT_CHANGES_ON_MODES[$content_changes_on_mode]) && $content_changes_on_mode != $this->getContentChangesOnMode()) /* Only update database if the mode is valid and there is an actual change */ 222 { 211 if (isset ($this->CONTENT_CHANGES_ON_MODES[$content_changes_on_mode]) && $content_changes_on_mode != $this->getContentChangesOnMode()) /* Only update database if the mode is valid and there is an actual change */ { 223 212 global $db; 224 213 $content_changes_on_mode = $db->escapeString($content_changes_on_mode); … … 227 216 $retval = true; 228 217 } 229 elseif (!isset ($this->CONTENT_CHANGES_ON_MODES[$content_changes_on_mode])) 230 { 218 elseif (!isset ($this->CONTENT_CHANGES_ON_MODES[$content_changes_on_mode])) { 231 219 $errormsg = _("Invalid content selection mode (must be part of CONTENT_CHANGES_ON_MODES)"); 232 220 $retval = false; 233 } 234 else 235 { 221 } else { 236 222 /* Successfull, but nothing modified */ 237 223 $retval = true; … … 242 228 /** Can the same content be shown twice 243 229 * @return 'YES', 'NO', 'ONCE_PER_NODE' */ 244 public function getAllowRepeat() 245 { 230 public function getAllowRepeat() { 246 231 return $this->content_group_row['allow_repeat']; 247 232 } … … 251 236 * @return true if successfull 252 237 * */ 253 protected function setAllowRepeat($allow_repeat, & $errormsg = null) 254 { 238 protected function setAllowRepeat($allow_repeat, & $errormsg = null) { 255 239 $retval = false; 256 if (isset ($this->ALLOW_REPEAT_MODES[$allow_repeat]) && $allow_repeat != $this->getAllowRepeat()) /* Only update database if the mode is valid and there is an actual change */ 257 { 240 if (isset ($this->ALLOW_REPEAT_MODES[$allow_repeat]) && $allow_repeat != $this->getAllowRepeat()) /* Only update database if the mode is valid and there is an actual change */ { 258 241 global $db; 259 242 $allow_repeat = $db->escapeString($allow_repeat); … … 262 245 $retval = true; 263 246 } 264 elseif (!isset ($this->ALLOW_REPEAT_MODES[$allow_repeat])) 265 { 247 elseif (!isset ($this->ALLOW_REPEAT_MODES[$allow_repeat])) { 266 248 $errormsg = _("Invalid content selection mode (must be part of ALLOW_REPEAT_MODES)"); 267 249 $retval = false; 268 } 269 else 270 { 250 } else { 271 251 /* Successfull, but nothing modified */ 272 252 $retval = true; … … 277 257 /** How many element should be picked for display at once? 278 258 * @return integer */ 279 public function getDisplayNumElements() 280 { 281 if($this->temporary_display_num_elements == null) 259 public function getDisplayNumElements() { 260 if ($this->temporary_display_num_elements == null) 282 261 return $this->content_group_row['display_num_elements']; 283 262 else … … 289 268 * @return true if successfull 290 269 * */ 291 protected function setDisplayNumElements($display_num_elements, & $errormsg = null) 292 { 270 protected function setDisplayNumElements($display_num_elements, & $errormsg = null) { 293 271 $retval = false; 294 if (($display_num_elements > 0) && $display_num_elements != $this->getDisplayNumElements()) /* Only update database if the mode is valid and there is an actual change */ 295 { 272 if (($display_num_elements > 0) && $display_num_elements != $this->getDisplayNumElements()) /* Only update database if the mode is valid and there is an actual change */ { 296 273 global $db; 297 274 $display_num_elements = $db->escapeString($display_num_elements); … … 300 277 $retval = true; 301 278 } 302 elseif ($display_num_elements <= 0) 303 { 279 elseif ($display_num_elements <= 0) { 304 280 $errormsg = _("You must display at least one element"); 305 281 $retval = false; 306 } 307 else 308 { 282 } else { 309 283 /* Successfull, but nothing modified */ 310 284 $retval = true; … … 318 292 * at once 319 293 */ 320 private function setTemporaryDisplayNumElements($temporary_num_elements) 321 { 294 private function setTemporaryDisplayNumElements($temporary_num_elements) { 322 295 $this->temporary_display_num_elements = $temporary_num_elements; 323 296 } 324 297 325 public function getAdminUI($subclass_admin_interface = null, $title=null) 326 { 298 public function getAdminUI($subclass_admin_interface = null, $title = null) { 327 299 $html = ''; 328 $html .= "<fieldset class='admin_element_group'>\n";329 $html .= "<legend>".sprintf(_("%s configuration"),get_class($this))."</legend>\n";300 $html .= "<fieldset class='admin_element_group'>\n"; 301 $html .= "<legend>" . sprintf(_("%s configuration"), get_class($this)) . "</legend>\n"; 330 302 331 303 /* is_artistic_content */ … … 333 305 $html .= "<div class='admin_element_label'>Is artistic content?: </div>\n"; 334 306 $html .= "<div class='admin_element_data'>\n"; 335 $name = "content_group_" .$this->id."_is_artistic_content";307 $name = "content_group_" . $this->id . "_is_artistic_content"; 336 308 $this->isArtisticContent() ? $checked = 'CHECKED' : $checked = ''; 337 309 $html .= "<input type='checkbox' name='$name' $checked>\n"; … … 341 313 /* is_locative_content */ 342 314 $html .= "<li class='admin_element_item_container'>\n"; 343 $html .= "<div class='admin_element_label'>" . ("Is locative content?").": </div>\n";315 $html .= "<div class='admin_element_label'>" . ("Is locative content?") . ": </div>\n"; 344 316 $html .= "<div class='admin_element_data'>\n"; 345 $name = "content_group_" .$this->id."_is_locative_content";317 $name = "content_group_" . $this->id . "_is_locative_content"; 346 318 $this->isLocativeContent() ? $checked = 'CHECKED' : $checked = ''; 347 319 $html .= "<input type='checkbox' name='$name' $checked>\n"; … … 351 323 /* content_ordering_mode */ 352 324 $html .= "<li class='admin_element_item_container'>\n"; 353 $html .= "<div class='admin_element_label'>" ._("In what order should the content displayed?").": </div>\n";325 $html .= "<div class='admin_element_label'>" . _("In what order should the content displayed?") . ": </div>\n"; 354 326 $html .= "<div class='admin_element_data'>\n"; 355 $name = "content_group_" .$this->id."_content_ordering_mode";327 $name = "content_group_" . $this->id . "_content_ordering_mode"; 356 328 357 329 $i = 0; 358 330 $tab = null; 359 foreach ($this->CONTENT_ORDERING_MODES as $select_mode_id => $select_mode_descr) 360 { 331 foreach ($this->CONTENT_ORDERING_MODES as $select_mode_id => $select_mode_descr) { 361 332 $tab[$i][0] = $select_mode_id; 362 333 $tab[$i][1] = $select_mode_descr; 363 $i ++;334 $i++; 364 335 } 365 336 $html .= FormSelectGenerator :: generateFromArray($tab, $this->getContentOrderingMode(), $name, null, false); … … 369 340 /*content_changes_on_mode */ 370 341 $html .= "<li class='admin_element_item_container'>\n"; 371 $html .= "<div class='admin_element_label'>" ._("When does the content rotate?").": </div>\n";342 $html .= "<div class='admin_element_label'>" . _("When does the content rotate?") . ": </div>\n"; 372 343 $html .= "<div class='admin_element_data'>\n"; 373 $name = "content_group_" .$this->id."_content_changes_on_mode";344 $name = "content_group_" . $this->id . "_content_changes_on_mode"; 374 345 $i = 0; 375 346 $tab = null; 376 foreach ($this->CONTENT_CHANGES_ON_MODES as $select_mode_id => $select_mode_descr) 377 { 347 foreach ($this->CONTENT_CHANGES_ON_MODES as $select_mode_id => $select_mode_descr) { 378 348 $tab[$i][0] = $select_mode_id; 379 349 $tab[$i][1] = $select_mode_descr; 380 $i ++;350 $i++; 381 351 } 382 352 $html .= FormSelectGenerator :: generateFromArray($tab, $this->getContentChangesOnMode(), $name, null, false); … … 386 356 /* allow_repeat*/ 387 357 $html .= "<li class='admin_element_item_container'>\n"; 388 $html .= "<div class='admin_element_label'>" ._("Can content be shown more than once to the same user?").": </div>\n";358 $html .= "<div class='admin_element_label'>" . _("Can content be shown more than once to the same user?") . ": </div>\n"; 389 359 $html .= "<div class='admin_element_data'>\n"; 390 $name = "content_group_" .$this->id."_allow_repeat";360 $name = "content_group_" . $this->id . "_allow_repeat"; 391 361 $i = 0; 392 362 $tab = null; 393 foreach ($this->ALLOW_REPEAT_MODES as $select_mode_id => $select_mode_descr) 394 { 363 foreach ($this->ALLOW_REPEAT_MODES as $select_mode_id => $select_mode_descr) { 395 364 $tab[$i][0] = $select_mode_id; 396 365 $tab[$i][1] = $select_mode_descr; 397 $i ++;366 $i++; 398 367 } 399 368 $html .= FormSelectGenerator :: generateFromArray($tab, $this->getAllowRepeat(), $name, null, false); … … 403 372 /*display_num_elements*/ 404 373 $html .= "<li class='admin_element_item_container'>\n"; 405 $html .= "<div class='admin_element_label'>" . ("Pick how many elements for each display?").": </div>\n";374 $html .= "<div class='admin_element_label'>" . ("Pick how many elements for each display?") . ": </div>\n"; 406 375 $html .= "<div class='admin_element_data'>\n"; 407 $name = "content_group_" .$this->id."_display_num_elements";376 $name = "content_group_" . $this->id . "_display_num_elements"; 408 377 $value = $this->getDisplayNumElements(); 409 378 $html .= "<input type='text' size='2' value='$value' name='$name'>\n"; … … 411 380 $html .= "</li>\n"; 412 381 $html .= "</fieldset>\n"; 413 382 414 383 $html .= "<li class='admin_element_item_container'>\n"; 415 384 $html .= "<fieldset class='admin_element_group'>\n"; 416 $html .= "<legend>".sprintf(_("%s display element list"),get_class($this))."</legend>\n";385 $html .= "<legend>" . sprintf(_("%s display element list"), get_class($this)) . "</legend>\n"; 417 386 418 387 /* content_group_element*/ 419 388 420 389 $html .= "<ul class='admin_element_list'>\n"; 421 foreach ($this->getElements() as $element) 422 { 390 foreach ($this->getElements() as $element) { 423 391 $html .= "<li class='admin_element_item_container'>\n"; 424 392 $html .= $element->getAdminUI(null, sprintf(_("%s %d"), get_class($element), $element->getDisplayOrder())); 425 393 $html .= "<div class='admin_element_tools'>\n"; 426 $name = "content_group_" .$this->id."_element_".$element->GetId()."_erase";427 $html .= "<input type='submit' class='submit' name='$name' value='" .sprintf(_("Delete %s %d"),get_class($element), $element->getDisplayOrder())."'>";394 $name = "content_group_" . $this->id . "_element_" . $element->GetId() . "_erase"; 395 $html .= "<input type='submit' class='submit' name='$name' value='" . sprintf(_("Delete %s %d"), get_class($element), $element->getDisplayOrder()) . "'>"; 428 396 $html .= "</div>\n"; 429 397 $html .= "</li>\n"; 430 398 } 431 399 $html .= "<li class='admin_element_item_container'>\n"; 432 $html .= self :: getNewContentUI("content_group_{$this->id}_new_element") ."<br>";400 $html .= self :: getNewContentUI("content_group_{$this->id}_new_element") . "<br>"; 433 401 $html .= "</li>\n"; 434 402 $html .= "<li class='admin_element_item_container'>\n"; … … 442 410 } 443 411 444 function processAdminUI() 445 { 412 function processAdminUI() { 446 413 // Init values 447 414 $errmsg = null; 448 415 449 if ($this->isOwner(User :: getCurrentUser()) || User :: getCurrentUser()->isSuperAdmin()) 450 { 416 if ($this->isOwner(User :: getCurrentUser()) || User :: getCurrentUser()->isSuperAdmin()) { 451 417 parent :: processAdminUI(); 452 418 453 419 /* is_artistic_content */ 454 $name = "content_group_" .$this->id."_is_artistic_content";420 $name = "content_group_" . $this->id . "_is_artistic_content"; 455 421 !empty ($_REQUEST[$name]) ? $this->setIsArtisticContent(true) : $this->setIsArtisticContent(false); 456 422 457 423 /* is_locative_content */ 458 $name = "content_group_" .$this->id."_is_locative_content";424 $name = "content_group_" . $this->id . "_is_locative_content"; 459 425 !empty ($_REQUEST[$name]) ? $this->setIsLocativeContent(true) : $this->setIsLocativeContent(false); 460 426 461 427 /* content_ordering_mode */ 462 $name = "content_group_" .$this->id."_content_ordering_mode";428 $name = "content_group_" . $this->id . "_content_ordering_mode"; 463 429 $this->setContentOrderingMode(FormSelectGenerator :: getResult($name, null)); 464 430 465 431 /*content_changes_on_mode */ 466 $name = "content_group_" .$this->id."_content_changes_on_mode";432 $name = "content_group_" . $this->id . "_content_changes_on_mode"; 467 433 $this->setContentChangesOnMode(FormSelectGenerator :: getResult($name, null)); 468 434 469 435 /* allow_repeat*/ 470 $name = "content_group_" .$this->id."_allow_repeat";436 $name = "content_group_" . $this->id . "_allow_repeat"; 471 437 $this->setAllowRepeat(FormSelectGenerator :: getResult($name, null)); 472 438 473 439 /*display_num_elements*/ 474 $name = "content_group_" .$this->id."_display_num_elements";440 $name = "content_group_" . $this->id . "_display_num_elements"; 475 441 $this->setDisplayNumElements($_REQUEST[$name]); 476 442 477 443 /* content_group_element */ 478 foreach ($this->getElements() as $element) 479 { 480 $name = "content_group_".$this->id."_element_".$element->GetId()."_erase"; 481 if (!empty ($_REQUEST[$name]) && $_REQUEST[$name] == true) 482 { 444 foreach ($this->getElements() as $element) { 445 $name = "content_group_" . $this->id . "_element_" . $element->GetId() . "_erase"; 446 if (!empty ($_REQUEST[$name]) && $_REQUEST[$name] == true) { 483 447 $element->delete($errmsg); 484 } 485 else 486 { 448 } else { 487 449 $element->processAdminUI(); 488 450 } … … 500 462 * @param $node Node, optionnal 501 463 * @return true or false */ 502 public function isDisplayableAt($node) 503 { 504 $old_curent_node = Node::getCurrentNode(); 505 Node::setCurrentNode($node); 506 507 if (count($this->getDisplayElements())>0) { 464 public function isDisplayableAt($node) { 465 $old_curent_node = Node :: getCurrentNode(); 466 Node :: setCurrentNode($node); 467 468 if (count($this->getDisplayElements()) > 0) { 508 469 $retval = true; 509 470 } else { … … 512 473 513 474 if ($old_curent_node != null) { 514 Node::setCurrentNode($old_curent_node); 515 } 516 517 return $retval; 518 } 519 475 Node :: setCurrentNode($old_curent_node); 476 } 477 478 return $retval; 479 } 520 480 521 481 /**Get the next element or elements to be displayed, depending on the display mode 522 482 * @return an array of ContentGroupElement or an empty arrray */ 523 function getDisplayElements() 524 { 483 function getDisplayElements() { 525 484 // Define globals 526 485 global $db; … … 533 492 $element_rows = null; 534 493 535 if ($user) 536 { 494 if ($user) { 537 495 $user_id = $user->getId(); 538 } 539 else 540 { 496 } else { 541 497 $user_id = ''; 542 498 } 543 499 $node = Node :: getCurrentNode(); 544 if ($node) 545 { 500 if ($node) { 546 501 $node_id = $node->getId(); 547 } 548 else 549 { 502 } else { 550 503 $node_id = ''; 551 504 } … … 560 513 561 514 $redisplay_objects = array (); 562 if ($content_changes_on_mode != 'ALWAYS') 563 { 515 if ($content_changes_on_mode != 'ALWAYS') { 564 516 $sql = "SELECT content_group_element_id FROM content_group_element \n"; 565 517 $sql .= "JOIN content_display_log ON (content_group_element_id=content_id) \n"; 566 518 $sql .= " WHERE content_group_id='$this->id' \n"; 567 519 568 if ($content_changes_on_mode == 'NEXT_DAY') 569 { 520 if ($content_changes_on_mode == 'NEXT_DAY') { 570 521 $sql .= "AND date_trunc('day', last_display_timestamp) = date_trunc('day', CURRENT_DATE) \n"; 571 522 } 572 if ($content_changes_on_mode == 'NEXT_LOGIN') 573 { 523 if ($content_changes_on_mode == 'NEXT_LOGIN') { 574 524 /**@todo Must fix, this will fail if the user never really connected from a hotspot... */ 575 525 $sql .= "AND last_display_timestamp > (SELECT timestamp_in FROM connections WHERE user_id='$user_id' ORDER BY timestamp_in DESC LIMIT 1) \n"; 576 526 } 577 if ($content_changes_on_mode == 'NEXT_NODE') 578 { 527 if ($content_changes_on_mode == 'NEXT_NODE') { 579 528 /** We find the close time of the last connection from another node */ 580 529 $sql .= "AND last_display_timestamp > (SELECT timestamp_out FROM connections WHERE user_id='$user_id' AND node_id != '$node_id' ORDER BY timestamp_in DESC LIMIT 1) \n"; … … 584 533 $db->execSql($sql, $redisplay_rows, false); 585 534 $redisplay_objects = array (); 586 if ($redisplay_rows != null) 587 { 588 foreach ($redisplay_rows as $redisplay_row) 589 { 535 if ($redisplay_rows != null) { 536 foreach ($redisplay_rows as $redisplay_row) { 590 537 $object = self :: getObject($redisplay_row['content_group_element_id']); 591 538 if ($object->isDisplayableAt(Node :: GetCurrentNode()) == true) /** Only content available at this hotspot are considered */ 592 {539 { 593 540 $redisplay_objects[] = $object; 594 541 } … … 601 548 602 549 $new_objects = array (); 603 if (count($redisplay_objects) < $display_num_elements) 604 {605 /* We need new content */ 606 607 $sql = "SELECT content_group_element_id FROM content_group_element WHERE content_group_id='$this->id' \n";550 if (count($redisplay_objects) < $display_num_elements) { 551 /* There aren't enough elements to redisplay, We need new content */ 552 553 $sql_base = "SELECT content_group_element_id FROM content_group_element WHERE content_group_id='$this->id' \n"; 554 $sql = $sql_base; 608 555 609 556 /*'YES' => "Content can be shown more than once", 'NO' => "Content can only be shown once", 'ONCE_PER_NODE' => "Content can be shown more than once, but not at the same node"*/ 610 557 $allow_repeat = $this->getAllowRepeat(); 611 612 if ($allow_repeat == 'NO') 613 { 614 $sql .= "AND content_group_element_id NOT IN (SELECT content_id FROM content_display_log WHERE user_id = '$user_id') \n"; 615 } 616 elseif ($allow_repeat == 'ONCE_PER_NODE') 617 { 618 $sql .= "AND content_group_element_id NOT IN (SELECT content_id FROM content_display_log WHERE user_id = '$user_id' AND node_id = '$node_id') \n"; 619 } 620 621 /* 'RANDOM' => "Pick content elements randomly",'SEQUENTIAL' => "Pick content elements in sequential order" */ 622 $content_ordering_mode = $this->getContentOrderingMode(); 623 624 if ($content_ordering_mode == 'SEQUENTIAL') 625 { 626 $order_by = ' ORDER BY display_order '; 627 $sql_last_order = "SELECT display_order FROM content_group_element \n"; 628 $sql_last_order .= "JOIN content_display_log ON (content_group_element_id=content_id) \n"; 629 $sql_last_order .= " WHERE content_group_id='$this->id' \n"; 630 $sql_last_order .= " ORDER BY last_display_timestamp DESC LIMIT 1"; 631 $db->execSqlUniqueRes($sql_last_order, $last_order_row, false); 632 if($last_order_row['display_order']!=null) 633 { 634 $last_order=$last_order_row['display_order']; 558 if ($allow_repeat == 'NO') { 559 $sql_repeat .= "AND content_group_element_id NOT IN (SELECT content_id FROM content_display_log WHERE user_id = '$user_id') \n"; 560 } 561 elseif ($allow_repeat == 'ONCE_PER_NODE') { 562 $sql_repeat .= "AND content_group_element_id NOT IN (SELECT content_id FROM content_display_log WHERE user_id = '$user_id' AND node_id = '$node_id') \n"; 635 563 } 636 564 else 637 565 { 638 $last_order=0; 639 } 640 } 641 else 642 { 566 $sql_repeat=null; 567 } 568 $sql .= $sql_repeat; 569 570 $content_ordering_mode = $this->getContentOrderingMode(); 571 if ($content_ordering_mode == 'SEQUENTIAL') { 572 $order_by = ' ORDER BY display_order '; 573 //Find the last content displayed 574 $sql_last_order = "SELECT display_order FROM content_group_element \n"; 575 $sql_last_order .= "JOIN content_display_log ON (content_group_element_id=content_id) \n"; 576 $sql_last_order .= " WHERE content_group_id='$this->id' \n"; 577 $sql_last_order .= " ORDER BY last_display_timestamp DESC LIMIT 1"; 578 $db->execSqlUniqueRes($sql_last_order, $last_order_row, false); 579 if ($last_order_row['display_order'] != null) { 580 $last_order = $last_order_row['display_order']; 581 } else { 582 $last_order = 0; 583 } 584 } else { 643 585 $order_by = ' '; 644 586 } 645 587 $sql .= $order_by; 646 588 589 $element_rows = null; 590 if ($content_ordering_mode == 'PSEUDO_RANDOM') { 591 //Special case, first get only the rows that haven't been displayed before' 592 $sql_no_repeat = " AND content_group_element_id NOT IN (SELECT content_id FROM content_display_log WHERE user_id = '$user_id') \n"; 593 $db->execSql($sql_base.$sql_no_repeat, $element_rows, false); 594 } 595 //Normal case, or there wasn't any undisplayed content in PSEUDO_RANDOM 596 if ($element_rows == null) { 647 597 $db->execSql($sql, $element_rows, false); 648 if ($element_rows == null)649 {598 } 599 if ($element_rows == null) { 650 600 $element_rows = array (); 651 601 } 652 foreach ($element_rows as $element_row) 653 { 602 foreach ($element_rows as $element_row) { 654 603 $object = self :: getObject($element_row['content_group_element_id']); 655 604 if ($object->isDisplayableAt(Node :: GetCurrentNode()) == true) /** Only content available at this hotspot are considered */ 656 {605 { 657 606 $new_objects[] = $object; 658 607 } 659 608 } 660 609 661 if ($content_ordering_mode == 'RANDOM') 662 { 610 if ($content_ordering_mode == 'RANDOM' || $content_ordering_mode == 'PSEUDO_RANDOM') { 663 611 shuffle($new_objects); 664 612 } 665 elseif($content_ordering_mode == 'SEQUENTIAL') 666 { 667 foreach($new_objects as $object) 668 { 669 if($object->getDisplayOrder()<=$last_order) 670 { 671 array_push ( $new_objects, array_shift ( $new_objects )); 613 elseif ($content_ordering_mode == 'SEQUENTIAL') { 614 foreach ($new_objects as $object) { 615 if ($object->getDisplayOrder() <= $last_order) { 616 array_push($new_objects, array_shift($new_objects)); 672 617 //echo " Pushed ".$object->getDisplayOrder(); 673 618 } … … 676 621 677 622 /** Pick the proper number of elements */ 678 $num_to_pick = $display_num_elements - count($redisplay_objects);623 $num_to_pick = $display_num_elements -count($redisplay_objects); 679 624 $new_objects = array_slice($new_objects, 0, $num_to_pick); 680 625 } … … 685 630 print_r($new_objects); 686 631 echo "</pre>"; 687 */632 */ 688 633 $retval = array_merge($new_objects, $redisplay_objects); 689 634 //echo count($retval).' returned <br>'; … … 696 641 * @param $status boolean 697 642 */ 698 protected function setIsExpandable($status) 699 { 700 if(is_bool($status)) 643 protected function setIsExpandable($status) { 644 if (is_bool($status)) 701 645 $this->is_expandable = $status; 702 646 } … … 705 649 * Tells if this object could be expanded 706 650 */ 707 protected function isExpandable() 708 { 651 protected function isExpandable() { 709 652 return $this->is_expandable; 710 653 } … … 714 657 * @param $status boolean 715 658 */ 716 public function setExpandStatus($status) 717 { 718 if($this->isExpandable() && is_bool($status)) 719 { 659 public function setExpandStatus($status) { 660 if ($this->isExpandable() && is_bool($status)) { 720 661 //TODO: Try to find a better solution to this problem... 721 if ($status == true)662 if ($status == true) 722 663 $this->setTemporaryDisplayNumElements(3000); 723 664 else … … 733 674 * NON expandable contents ie PatternLanguage will NEVER return true 734 675 */ 735 public function getExpandStatus() 736 { 737 if($this->expand_status == null) 676 public function getExpandStatus() { 677 if ($this->expand_status == null) 738 678 return false; 739 679 return $this->expand_status; … … 746 686 * elements that need to be hidden before subscription 747 687 * @return The HTML fragment for this interface */ 748 public function getUserUI($subclass_user_interface = null, $hide_elements = false) 749 { 688 public function getUserUI($subclass_user_interface = null, $hide_elements = false) { 750 689 $html = ''; 751 $html .= "<div class='user_ui_container ".get_class($this)."'>\n"; 752 753 if($hide_elements == false) 754 { 690 $html .= "<div class='user_ui_container " . get_class($this) . "'>\n"; 691 692 if ($hide_elements == false) { 755 693 $display_elements = $this->getDisplayElements(); 756 if (count($display_elements) > 0) 757 { 758 foreach ($display_elements as $display_element) 759 { 694 if (count($display_elements) > 0) { 695 foreach ($display_elements as $display_element) { 760 696 // If the content group logging is disabled, all the children will inherit this property temporarly 761 if ($this->getLoggingStatus() == false)697 if ($this->getLoggingStatus() == false) 762 698 $display_element->setLoggingStatus(false); 763 699 $html .= $display_element->getUserUI(); 764 700 } 765 } 766 else 767 { 768 $html .= '<p class="warningmsg">'._("Sorry, no elements available at this hotspot or all elements of the content group have already been shown")."</p>\n"; 701 } else { 702 $html .= '<p class="warningmsg">' . _("Sorry, no elements available at this hotspot or all elements of the content group have already been shown") . "</p>\n"; 769 703 } 770 704 } … … 778 712 /**Get all elements 779 713 * @return an array of ContentGroupElement or an empty arrray */ 780 function getElements() 781 { 714 function getElements() { 782 715 // Define globals 783 716 global $db; … … 789 722 $sql = "SELECT content_group_element_id FROM content_group_element WHERE content_group_id='$this->id' ORDER BY display_order"; 790 723 $db->execSql($sql, $element_rows, false); 791 if ($element_rows != null) 792 { 793 foreach ($element_rows as $element_row) 794 { 724 if ($element_rows != null) { 725 foreach ($element_rows as $element_row) { 795 726 $retval[] = self :: getObject($element_row['content_group_element_id']); 796 727 } … … 801 732 /** Delete this Content from the database 802 733 */ 803 public function delete(& $errmsg) 804 { 805 if ($this->isPersistent() == false) 806 { 807 foreach ($this->getElements() as $element) 808 { 734 public function delete(& $errmsg) { 735 if ($this->isPersistent() == false) { 736 foreach ($this->getElements() as $element) { 809 737 $element->delete($errmsg); 810 738 } … … 812 740 return parent :: delete($errmsg); 813 741 } 814 /** Reloads the object from the database. Should normally be called after a set operation. 815 * This function is private because calling it from a subclass will call the 816 * constructor from the wrong scope */ 817 private function refresh() 818 { 742 /** Reloads the object from the database. Should normally be called after a set operation. 743 * This function is private because calling it from a subclass will call the 744 * constructor from the wrong scope */ 745 private function refresh() { 819 746 $this->__construct($this->id); 820 747 } … … 829 756 * End: 830 757 */ 831 832 -
trunk/wifidog-auth/wifidog/classes/Network.php
r1083 r1085 177 177 $html = ''; 178 178 $name = $user_prefix; 179 $html .= _("Network:")." \n";180 179 181 180 if ($pre_selected_network) { … … 202 201 $i ++; 203 202 } 203 $html .= _("Network:")." \n"; 204 204 $html .= FormSelectGenerator :: generateFromArray($tab, $selected_id, $name, null, false); 205 205 … … 208 208 foreach ($network_rows as $network_row) //iterates only once... 209 209 { 210 $html .= " $network_row[name] "; 210 //$html .= _("Network:")." \n"; 211 //$html .= " $network_row[name] "; 211 212 $html .= "<input type='hidden' name='$name' value='".htmlspecialchars($network_row['network_id'], ENT_QUOTES, 'UTF-8')."'>"; 212 213 } -
trunk/wifidog-auth/wifidog/classes/Server.php
r1070 r1085 222 222 223 223 if ($_server_row == null && !$silent) { 224 throw new Exception( _("Server::getCurrentServer: Fatal error: Unable to find current server in the database!"));224 throw new Exception(sprintf(_("Server::getCurrentServer: Fatal error: Unable to find a server matching hostname %s in the database!"), $_SERVER['SERVER_NAME'])); 225 225 } else if ($_server_row != null) { 226 226 $_retVal = new self($_server_row['server_id']); -
trunk/wifidog-auth/wifidog/include/schema_validate.php
r1084 r1085 47 47 * Define current database schema version 48 48 */ 49 define('REQUIRED_SCHEMA_VERSION', 4 4);49 define('REQUIRED_SCHEMA_VERSION', 45); 50 50 51 51 /** … … 909 909 } 910 910 911 $new_schema_version = 45; 912 if ($schema_version < $new_schema_version) { 913 printUpdateVersion($new_schema_version); 914 $sql .= "\n\nUPDATE schema_info SET value='$new_schema_version' WHERE tag='schema_version';\n"; 915 $sql .= "ALTER TABLE content DROP COLUMN sponsor_info;\n"; 916 $sql .= "ALTER TABLE users DROP CONSTRAINT account_origin_fkey;\n"; 917 $sql .= "ALTER TABLE users ADD CONSTRAINT account_origin_fkey FOREIGN KEY (account_origin) REFERENCES networks (network_id) ON UPDATE CASCADE ON DELETE CASCADE;\n"; 918 $sql .= "ALTER TABLE nodes DROP CONSTRAINT network_id_fkey;\n"; 919 $sql .= "ALTER TABLE nodes ADD CONSTRAINT network_id_fkey FOREIGN KEY (network_id) REFERENCES networks (network_id) ON UPDATE CASCADE ON DELETE CASCADE;\n"; 920 $sql .= "ALTER TABLE users DROP CONSTRAINT check_account_origin_not_empty;\n"; 921 $sql .= "ALTER TABLE connections DROP CONSTRAINT fk_nodes;\n"; 922 $sql .= "ALTER TABLE connections ADD CONSTRAINT fk_nodes FOREIGN KEY (node_id) REFERENCES nodes (node_id) ON UPDATE CASCADE ON DELETE CASCADE;\n"; 923 $sql .= "ALTER TABLE connections DROP CONSTRAINT fk_users;\n"; 924 $sql .= "ALTER TABLE connections ADD CONSTRAINT fk_users FOREIGN KEY (user_id) REFERENCES users (user_id) ON UPDATE CASCADE ON DELETE CASCADE;\n"; 925 $sql .= "ALTER TABLE node_stakeholders DROP CONSTRAINT \"$2\";\n"; 926 $sql .= "ALTER TABLE node_stakeholders ADD CONSTRAINT fk_users FOREIGN KEY (user_id) REFERENCES users (user_id) ON UPDATE CASCADE ON DELETE CASCADE;\n"; 927 $sql .= "ALTER TABLE network_stakeholders DROP CONSTRAINT \"$1\";\n"; 928 $sql .= "ALTER TABLE network_stakeholders ADD CONSTRAINT fk_network FOREIGN KEY (network_id) REFERENCES networks (network_id) ON UPDATE CASCADE ON DELETE CASCADE;\n"; 929 $sql .= "ALTER TABLE network_stakeholders DROP CONSTRAINT \"$2\";\n"; 930 $sql .= "ALTER TABLE network_stakeholders ADD CONSTRAINT fk_users FOREIGN KEY (user_id) REFERENCES users (user_id) ON UPDATE CASCADE ON DELETE CASCADE;\n"; 931 $sql .= "ALTER TABLE content ADD COLUMN title_is_displayed bool;\n"; 932 $sql .= "ALTER TABLE content ALTER COLUMN title_is_displayed SET DEFAULT true;\n"; 933 $sql .= "UPDATE content SET title_is_displayed=true;\n"; 934 $sql .= "ALTER TABLE content ALTER COLUMN title_is_displayed SET NOT NULL;\n\n"; 935 936 937 } 911 938 /* 912 939 $new_schema_version = 44; -
trunk/wifidog-auth/wifidog/media/base_theme/stylesheet.css
r1070 r1085 565 565 background-color: rgb(235, 235, 235); 566 566 } 567 .user_ui_sponsor_info {568 background-color: rgb(235, 235, 235);569 }570 567 .list_ui_container { 571 568 display: inline;
