Changeset 545
- Timestamp:
- 04/14/05 11:13:05 (8 years ago)
- Location:
- trunk/wifidog-auth
- Files:
-
- 11 added
- 23 modified
-
ChangeLog (modified) (1 diff)
-
sql/dump_initial_data_postgres.sh (modified) (1 diff)
-
sql/sync_sql_for_cvs.sh (modified) (1 diff)
-
sql/wifidog-postgres-initial-data.sql (modified) (4 diffs)
-
sql/wifidog-postgres-schema.sql (modified) (32 diffs)
-
wifidog/admin/admin_common.php (modified) (1 diff)
-
wifidog/admin/content_admin.php (added)
-
wifidog/admin/hotspot.php (modified) (1 diff)
-
wifidog/admin/hotspot_log.php (modified) (1 diff)
-
wifidog/admin/hotspot_owner.php (modified) (1 diff)
-
wifidog/admin/import_user_database.php (modified) (1 diff)
-
wifidog/admin/index.php (modified) (1 diff)
-
wifidog/admin/online_users.php (modified) (1 diff)
-
wifidog/admin/templates/main.html (modified) (2 diffs)
-
wifidog/admin/user_log.php (modified) (1 diff)
-
wifidog/admin/user_stats.php (modified) (1 diff)
-
wifidog/classes/AbstractDbPostgres.php (modified) (1 diff)
-
wifidog/classes/Content (added)
-
wifidog/classes/Content.php (added)
-
wifidog/classes/Content/ContentGroup.php (added)
-
wifidog/classes/Content/ContentGroupElement.php (added)
-
wifidog/classes/Content/Langstring.php (added)
-
wifidog/classes/Content/PatternLanguage.php (added)
-
wifidog/classes/Content/TrivialLangstring.php (added)
-
wifidog/classes/FormSelectGenerator.php (added)
-
wifidog/classes/Locale.php (added)
-
wifidog/classes/LocaleList.php (added)
-
wifidog/classes/Node.php (modified) (1 diff)
-
wifidog/classes/Security.php (modified) (1 diff)
-
wifidog/classes/User.php (modified) (2 diffs)
-
wifidog/config.php (modified) (2 diffs)
-
wifidog/include/common_interface.php (modified) (1 diff)
-
wifidog/include/schema_validate.php (modified) (4 diffs)
-
wifidog/local_content/default/stylesheet.css (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/wifidog-auth/ChangeLog
r544 r545 1 2005-04-14 Benoit Grégoire <bock@step.polymtl.ca> 2 * First part of the future content delivery infrastructure. Many files added. 3 1 4 2005-04-01 François Proulx <francois.proulx@gmail.com> 2 5 * Modified gen.sh script to match UTF-8 -
trunk/wifidog-auth/sql/dump_initial_data_postgres.sh
r530 r545 10 10 11 11 pg_dump -a -D --username=wifidog -t schema_info 12 12 pg_dump -a -D --username=wifidog -t locales 13 13 echo "COMMIT;" -
trunk/wifidog-auth/sql/sync_sql_for_cvs.sh
r523 r545 1 1 #!/bin/sh 2 echo "Note: When prompted for a password,enter the wifidog database user's password"2 echo "Note: You will be prompted for a password several times; enter the wifidog database user's password" 3 3 sh dump_initial_data_postgres.sh > wifidog-postgres-initial-data.sql 4 4 chmod a+r wifidog-postgres-initial-data.sql -
trunk/wifidog-auth/sql/wifidog-postgres-initial-data.sql
r530 r545 13 13 14 14 -- 15 -- Data for TOC entry 2 (OID 1 44784)15 -- Data for TOC entry 2 (OID 192400) 16 16 -- Name: token_status; Type: TABLE DATA; Schema: public; Owner: wifidog 17 17 -- … … 34 34 35 35 -- 36 -- Data for TOC entry 2 (OID 1 44818)36 -- Data for TOC entry 2 (OID 192434) 37 37 -- Name: venue_types; Type: TABLE DATA; Schema: public; Owner: wifidog 38 38 -- … … 86 86 87 87 -- 88 -- Data for TOC entry 2 (OID 1 44816)88 -- Data for TOC entry 2 (OID 192432) 89 89 -- Name: node_deployment_status; Type: TABLE DATA; Schema: public; Owner: wifidog 90 90 -- … … 111 111 112 112 -- 113 -- Data for TOC entry 2 (OID 1 44828)113 -- Data for TOC entry 2 (OID 192444) 114 114 -- Name: schema_info; Type: TABLE DATA; Schema: public; Owner: wifidog 115 115 -- 116 116 117 INSERT INTO schema_info (tag, value) VALUES ('schema_version', '5'); 117 INSERT INTO schema_info (tag, value) VALUES ('schema_version', '6'); 118 119 120 -- 121 -- PostgreSQL database dump 122 -- 123 124 SET client_encoding = 'UNICODE'; 125 SET check_function_bodies = false; 126 127 SET SESSION AUTHORIZATION 'wifidog'; 128 129 SET search_path = public, pg_catalog; 130 131 -- 132 -- Data for TOC entry 2 (OID 214063) 133 -- Name: locales; Type: TABLE DATA; Schema: public; Owner: wifidog 134 -- 135 136 INSERT INTO locales (locales_id) VALUES ('fr'); 137 INSERT INTO locales (locales_id) VALUES ('en'); 118 138 119 139 -
trunk/wifidog-auth/sql/wifidog-postgres-schema.sql
r530 r545 22 22 23 23 -- 24 -- TOC entry 5 (OID 1 44781)24 -- TOC entry 5 (OID 192397) 25 25 -- Name: administrators; Type: TABLE; Schema: public; Owner: wifidog 26 26 -- … … 32 32 33 33 -- 34 -- TOC entry 6 (OID 1 44784)34 -- TOC entry 6 (OID 192400) 35 35 -- Name: token_status; Type: TABLE; Schema: public; Owner: wifidog 36 36 -- … … 42 42 43 43 -- 44 -- TOC entry 7 (OID 1 44788)44 -- TOC entry 7 (OID 192404) 45 45 -- Name: connections; Type: TABLE; Schema: public; Owner: wifidog 46 46 -- … … 64 64 65 65 -- 66 -- TOC entry 8 (OID 1 44794)66 -- TOC entry 8 (OID 192410) 67 67 -- Name: nodes; Type: TABLE; Schema: public; Owner: wifidog 68 68 -- … … 89 89 90 90 -- 91 -- TOC entry 9 (OID 1 44804)91 -- TOC entry 9 (OID 192420) 92 92 -- Name: users; Type: TABLE; Schema: public; Owner: wifidog 93 93 -- … … 102 102 username text, 103 103 account_origin text NOT NULL, 104 never_show_username boolean DEFAULT false, 105 real_name text, 106 website text, 107 prefered_locale text, 104 108 CONSTRAINT check_account_origin_not_empty CHECK ((account_origin <> ''::text)), 105 109 CONSTRAINT check_user_not_empty CHECK (((user_id)::text <> ''::text)) … … 108 112 109 113 -- 110 -- TOC entry 10 (OID 1 44814)114 -- TOC entry 10 (OID 192430) 111 115 -- Name: node_owners; Type: TABLE; Schema: public; Owner: wifidog 112 116 -- … … 119 123 120 124 -- 121 -- TOC entry 11 (OID 1 44816)125 -- TOC entry 11 (OID 192432) 122 126 -- Name: node_deployment_status; Type: TABLE; Schema: public; Owner: wifidog 123 127 -- … … 129 133 130 134 -- 131 -- TOC entry 12 (OID 1 44818)135 -- TOC entry 12 (OID 192434) 132 136 -- Name: venue_types; Type: TABLE; Schema: public; Owner: wifidog 133 137 -- … … 139 143 140 144 -- 141 -- TOC entry 13 (OID 1 44823)145 -- TOC entry 13 (OID 192439) 142 146 -- Name: venues; Type: TABLE; Schema: public; Owner: wifidog 143 147 -- … … 150 154 151 155 -- 152 -- TOC entry 14 (OID 1 44828)156 -- TOC entry 14 (OID 192444) 153 157 -- Name: schema_info; Type: TABLE; Schema: public; Owner: wifidog 154 158 -- … … 161 165 162 166 -- 163 -- TOC entry 18 (OID 144841) 167 -- TOC entry 15 (OID 214063) 168 -- Name: locales; Type: TABLE; Schema: public; Owner: wifidog 169 -- 170 171 CREATE TABLE locales ( 172 locales_id text NOT NULL 173 ); 174 175 176 -- 177 -- TOC entry 16 (OID 214077) 178 -- Name: content; Type: TABLE; Schema: public; Owner: wifidog 179 -- 180 181 CREATE TABLE content ( 182 content_id text NOT NULL, 183 content_type text NOT NULL, 184 title text, 185 description text, 186 project_info text, 187 sponsor_info text, 188 creation_timestamp timestamp without time zone DEFAULT now(), 189 CONSTRAINT content_type_not_empty_string CHECK ((content_type <> ''::text)) 190 ); 191 192 193 -- 194 -- TOC entry 17 (OID 214102) 195 -- Name: content_has_owners; Type: TABLE; Schema: public; Owner: wifidog 196 -- 197 198 CREATE TABLE content_has_owners ( 199 content_id text NOT NULL, 200 user_id text NOT NULL, 201 is_author boolean NOT NULL, 202 owner_since timestamp without time zone DEFAULT now() 203 ); 204 205 206 -- 207 -- TOC entry 18 (OID 214118) 208 -- Name: langstring_entries; Type: TABLE; Schema: public; Owner: wifidog 209 -- 210 211 CREATE TABLE langstring_entries ( 212 langstring_entries_id text NOT NULL, 213 langstrings_id text, 214 locales_id text, 215 value text DEFAULT ''::text 216 ); 217 218 219 -- 220 -- TOC entry 19 (OID 214134) 221 -- Name: content_group; Type: TABLE; Schema: public; Owner: wifidog 222 -- 223 224 CREATE TABLE content_group ( 225 content_group_id text NOT NULL, 226 is_artistic_content boolean DEFAULT false NOT NULL, 227 is_locative_content boolean DEFAULT false NOT NULL, 228 content_selection_mode text 229 ); 230 231 232 -- 233 -- TOC entry 20 (OID 214145) 234 -- Name: content_group_element; Type: TABLE; Schema: public; Owner: wifidog 235 -- 236 237 CREATE TABLE content_group_element ( 238 content_group_element_id text NOT NULL, 239 content_group_id text NOT NULL, 240 display_order integer DEFAULT 1, 241 displayed_content_id text, 242 force_only_allowed_node boolean 243 ); 244 245 246 -- 247 -- TOC entry 21 (OID 214166) 248 -- Name: content_group_element_portal_display_log; Type: TABLE; Schema: public; Owner: wifidog 249 -- 250 251 CREATE TABLE content_group_element_portal_display_log ( 252 user_id text NOT NULL, 253 content_group_element_id text NOT NULL, 254 display_timestamp timestamp without time zone DEFAULT now() NOT NULL, 255 node_id text 256 ); 257 258 259 -- 260 -- TOC entry 22 (OID 214186) 261 -- Name: user_has_content; Type: TABLE; Schema: public; Owner: wifidog 262 -- 263 264 CREATE TABLE user_has_content ( 265 user_id text NOT NULL, 266 content_id text NOT NULL, 267 subscribe_timestamp timestamp without time zone DEFAULT now() NOT NULL 268 ); 269 270 271 -- 272 -- TOC entry 23 (OID 214202) 273 -- Name: node_has_content; Type: TABLE; Schema: public; Owner: wifidog 274 -- 275 276 CREATE TABLE node_has_content ( 277 node_id text NOT NULL, 278 content_id text NOT NULL, 279 subscribe_timestamp timestamp without time zone DEFAULT now() NOT NULL 280 ); 281 282 283 -- 284 -- TOC entry 24 (OID 214218) 285 -- Name: network_has_content; Type: TABLE; Schema: public; Owner: wifidog 286 -- 287 288 CREATE TABLE network_has_content ( 289 network_id text NOT NULL, 290 content_id text NOT NULL, 291 subscribe_timestamp timestamp without time zone DEFAULT now() NOT NULL 292 ); 293 294 295 -- 296 -- TOC entry 25 (OID 214271) 297 -- Name: content_group_element_has_allowed_nodes; Type: TABLE; Schema: public; Owner: wifidog 298 -- 299 300 CREATE TABLE content_group_element_has_allowed_nodes ( 301 content_group_element_id text NOT NULL, 302 node_id text NOT NULL, 303 allowed_since timestamp without time zone DEFAULT now() 304 ); 305 306 307 -- 308 -- TOC entry 29 (OID 214009) 164 309 -- Name: idx_token; Type: INDEX; Schema: public; Owner: wifidog 165 310 -- … … 169 314 170 315 -- 171 -- TOC entry 19 (OID 144842)316 -- TOC entry 30 (OID 214010) 172 317 -- Name: idx_token_status_and_user_id; Type: INDEX; Schema: public; Owner: wifidog 173 318 -- … … 177 322 178 323 -- 179 -- TOC entry 21 (OID 144843)324 -- TOC entry 32 (OID 214011) 180 325 -- Name: idx_unique_username_and_account_origin; Type: INDEX; Schema: public; Owner: wifidog 181 326 -- … … 185 330 186 331 -- 187 -- TOC entry 15 (OID 144844) 332 -- TOC entry 44 (OID 214165) 333 -- Name: idx_content_group_element_content_group_id; Type: INDEX; Schema: public; Owner: wifidog 334 -- 335 336 CREATE INDEX idx_content_group_element_content_group_id ON content_group_element USING btree (content_group_id); 337 338 339 -- 340 -- TOC entry 26 (OID 214012) 188 341 -- Name: administrators_pkey; Type: CONSTRAINT; Schema: public; Owner: wifidog 189 342 -- … … 194 347 195 348 -- 196 -- TOC entry 16 (OID 144846)349 -- TOC entry 27 (OID 214014) 197 350 -- Name: token_status_pkey; Type: CONSTRAINT; Schema: public; Owner: wifidog 198 351 -- … … 203 356 204 357 -- 205 -- TOC entry 17 (OID 144848)358 -- TOC entry 28 (OID 214016) 206 359 -- Name: connections_pkey; Type: CONSTRAINT; Schema: public; Owner: wifidog 207 360 -- … … 212 365 213 366 -- 214 -- TOC entry 20 (OID 144850)367 -- TOC entry 31 (OID 214018) 215 368 -- Name: nodes_pkey; Type: CONSTRAINT; Schema: public; Owner: wifidog 216 369 -- … … 221 374 222 375 -- 223 -- TOC entry 22 (OID 144852)376 -- TOC entry 33 (OID 214020) 224 377 -- Name: users_pkey; Type: CONSTRAINT; Schema: public; Owner: wifidog 225 378 -- … … 230 383 231 384 -- 232 -- TOC entry 23 (OID 144854)385 -- TOC entry 34 (OID 214022) 233 386 -- Name: node_owners_pkey; Type: CONSTRAINT; Schema: public; Owner: wifidog 234 387 -- … … 239 392 240 393 -- 241 -- TOC entry 24 (OID 144856)394 -- TOC entry 35 (OID 214024) 242 395 -- Name: node_deployment_status_pkey; Type: CONSTRAINT; Schema: public; Owner: wifidog 243 396 -- … … 248 401 249 402 -- 250 -- TOC entry 25 (OID 144858)403 -- TOC entry 36 (OID 214026) 251 404 -- Name: venue_types_pkey; Type: CONSTRAINT; Schema: public; Owner: wifidog 252 405 -- … … 257 410 258 411 -- 259 -- TOC entry 26 (OID 144860)412 -- TOC entry 37 (OID 214028) 260 413 -- Name: schema_info_pkey; Type: CONSTRAINT; Schema: public; Owner: wifidog 261 414 -- … … 266 419 267 420 -- 268 -- TOC entry 28 (OID 144862) 421 -- TOC entry 38 (OID 214068) 422 -- Name: locales_pkey; Type: CONSTRAINT; Schema: public; Owner: wifidog 423 -- 424 425 ALTER TABLE ONLY locales 426 ADD CONSTRAINT locales_pkey PRIMARY KEY (locales_id); 427 428 429 -- 430 -- TOC entry 39 (OID 214084) 431 -- Name: content_pkey; Type: CONSTRAINT; Schema: public; Owner: wifidog 432 -- 433 434 ALTER TABLE ONLY content 435 ADD CONSTRAINT content_pkey PRIMARY KEY (content_id); 436 437 438 -- 439 -- TOC entry 40 (OID 214108) 440 -- Name: content_has_owners_pkey; Type: CONSTRAINT; Schema: public; Owner: wifidog 441 -- 442 443 ALTER TABLE ONLY content_has_owners 444 ADD CONSTRAINT content_has_owners_pkey PRIMARY KEY (content_id, user_id); 445 446 447 -- 448 -- TOC entry 41 (OID 214124) 449 -- Name: langstring_entries_pkey; Type: CONSTRAINT; Schema: public; Owner: wifidog 450 -- 451 452 ALTER TABLE ONLY langstring_entries 453 ADD CONSTRAINT langstring_entries_pkey PRIMARY KEY (langstring_entries_id); 454 455 456 -- 457 -- TOC entry 42 (OID 214139) 458 -- Name: content_group_pkey; Type: CONSTRAINT; Schema: public; Owner: wifidog 459 -- 460 461 ALTER TABLE ONLY content_group 462 ADD CONSTRAINT content_group_pkey PRIMARY KEY (content_group_id); 463 464 465 -- 466 -- TOC entry 43 (OID 214151) 467 -- Name: content_group_element_pkey; Type: CONSTRAINT; Schema: public; Owner: wifidog 468 -- 469 470 ALTER TABLE ONLY content_group_element 471 ADD CONSTRAINT content_group_element_pkey PRIMARY KEY (content_group_element_id); 472 473 474 -- 475 -- TOC entry 45 (OID 214172) 476 -- Name: content_group_element_portal_display_log_pkey; Type: CONSTRAINT; Schema: public; Owner: wifidog 477 -- 478 479 ALTER TABLE ONLY content_group_element_portal_display_log 480 ADD CONSTRAINT content_group_element_portal_display_log_pkey PRIMARY KEY (user_id, content_group_element_id, display_timestamp); 481 482 483 -- 484 -- TOC entry 46 (OID 214192) 485 -- Name: user_has_content_pkey; Type: CONSTRAINT; Schema: public; Owner: wifidog 486 -- 487 488 ALTER TABLE ONLY user_has_content 489 ADD CONSTRAINT user_has_content_pkey PRIMARY KEY (user_id, content_id); 490 491 492 -- 493 -- TOC entry 47 (OID 214208) 494 -- Name: node_has_content_pkey; Type: CONSTRAINT; Schema: public; Owner: wifidog 495 -- 496 497 ALTER TABLE ONLY node_has_content 498 ADD CONSTRAINT node_has_content_pkey PRIMARY KEY (node_id, content_id); 499 500 501 -- 502 -- TOC entry 48 (OID 214224) 503 -- Name: network_has_content_pkey; Type: CONSTRAINT; Schema: public; Owner: wifidog 504 -- 505 506 ALTER TABLE ONLY network_has_content 507 ADD CONSTRAINT network_has_content_pkey PRIMARY KEY (network_id, content_id); 508 509 510 -- 511 -- TOC entry 49 (OID 214277) 512 -- Name: content_group_element_has_allowed_nodes_pkey; Type: CONSTRAINT; Schema: public; Owner: wifidog 513 -- 514 515 ALTER TABLE ONLY content_group_element_has_allowed_nodes 516 ADD CONSTRAINT content_group_element_has_allowed_nodes_pkey PRIMARY KEY (content_group_element_id, node_id); 517 518 519 -- 520 -- TOC entry 51 (OID 214030) 269 521 -- Name: $1; Type: FK CONSTRAINT; Schema: public; Owner: wifidog 270 522 -- … … 275 527 276 528 -- 277 -- TOC entry 27 (OID 144866)529 -- TOC entry 50 (OID 214034) 278 530 -- Name: administrators_ibfk_1; Type: FK CONSTRAINT; Schema: public; Owner: wifidog 279 531 -- … … 284 536 285 537 -- 286 -- TOC entry 29 (OID 144870)538 -- TOC entry 52 (OID 214038) 287 539 -- Name: fk_users; Type: FK CONSTRAINT; Schema: public; Owner: wifidog 288 540 -- … … 293 545 294 546 -- 295 -- TOC entry 30 (OID 144874)547 -- TOC entry 53 (OID 214042) 296 548 -- Name: fk_nodes; Type: FK CONSTRAINT; Schema: public; Owner: wifidog 297 549 -- … … 302 554 303 555 -- 304 -- TOC entry 33 (OID 144878)556 -- TOC entry 57 (OID 214046) 305 557 -- Name: fk_users; Type: FK CONSTRAINT; Schema: public; Owner: wifidog 306 558 -- … … 311 563 312 564 -- 313 -- TOC entry 34 (OID 144882)565 -- TOC entry 58 (OID 214050) 314 566 -- Name: fk_nodes; Type: FK CONSTRAINT; Schema: public; Owner: wifidog 315 567 -- … … 320 572 321 573 -- 322 -- TOC entry 31 (OID 144886)574 -- TOC entry 54 (OID 214054) 323 575 -- Name: fk_node_deployment_status; Type: FK CONSTRAINT; Schema: public; Owner: wifidog 324 576 -- … … 329 581 330 582 -- 331 -- TOC entry 32 (OID 144890)583 -- TOC entry 55 (OID 214058) 332 584 -- Name: fk_venue_types; Type: FK CONSTRAINT; Schema: public; Owner: wifidog 333 585 -- … … 338 590 339 591 -- 592 -- TOC entry 56 (OID 214073) 593 -- Name: $1; Type: FK CONSTRAINT; Schema: public; Owner: wifidog 594 -- 595 596 ALTER TABLE ONLY users 597 ADD CONSTRAINT "$1" FOREIGN KEY (prefered_locale) REFERENCES locales(locales_id) ON UPDATE CASCADE ON DELETE SET NULL; 598 599 600 -- 601 -- TOC entry 59 (OID 214086) 602 -- Name: $1; Type: FK CONSTRAINT; Schema: public; Owner: wifidog 603 -- 604 605 ALTER TABLE ONLY content 606 ADD CONSTRAINT "$1" FOREIGN KEY (title) REFERENCES content(content_id) ON UPDATE CASCADE ON DELETE RESTRICT; 607 608 609 -- 610 -- TOC entry 60 (OID 214090) 611 -- Name: $2; Type: FK CONSTRAINT; Schema: public; Owner: wifidog 612 -- 613 614 ALTER TABLE ONLY content 615 ADD CONSTRAINT "$2" FOREIGN KEY (description) REFERENCES content(content_id) ON UPDATE CASCADE ON DELETE RESTRICT; 616 617 618 -- 619 -- TOC entry 61 (OID 214094) 620 -- Name: $3; Type: FK CONSTRAINT; Schema: public; Owner: wifidog 621 -- 622 623 ALTER TABLE ONLY content 624 ADD CONSTRAINT "$3" FOREIGN KEY (project_info) REFERENCES content(content_id) ON UPDATE CASCADE ON DELETE RESTRICT; 625 626 627 -- 628 -- TOC entry 62 (OID 214098) 629 -- Name: $4; Type: FK CONSTRAINT; Schema: public; Owner: wifidog 630 -- 631 632 ALTER TABLE ONLY content 633 ADD CONSTRAINT "$4" FOREIGN KEY (sponsor_info) REFERENCES content(content_id) ON UPDATE CASCADE ON DELETE RESTRICT; 634 635 636 -- 637 -- TOC entry 63 (OID 214110) 638 -- Name: $1; Type: FK CONSTRAINT; Schema: public; Owner: wifidog 639 -- 640 641 ALTER TABLE ONLY content_has_owners 642 ADD CONSTRAINT "$1" FOREIGN KEY (content_id) REFERENCES content(content_id) ON UPDATE CASCADE ON DELETE CASCADE; 643 644 645 -- 646 -- TOC entry 64 (OID 214114) 647 -- Name: $2; Type: FK CONSTRAINT; Schema: public; Owner: wifidog 648 -- 649 650 ALTER TABLE ONLY content_has_owners 651 ADD CONSTRAINT "$2" FOREIGN KEY (user_id) REFERENCES users(user_id) ON UPDATE CASCADE ON DELETE CASCADE; 652 653 654 -- 655 -- TOC entry 65 (OID 214126) 656 -- Name: $1; Type: FK CONSTRAINT; Schema: public; Owner: wifidog 657 -- 658 659 ALTER TABLE ONLY langstring_entries 660 ADD CONSTRAINT "$1" FOREIGN KEY (langstrings_id) REFERENCES content(content_id) ON UPDATE CASCADE ON DELETE CASCADE; 661 662 663 -- 664 -- TOC entry 66 (OID 214130) 665 -- Name: $2; Type: FK CONSTRAINT; Schema: public; Owner: wifidog 666 -- 667 668 ALTER TABLE ONLY langstring_entries 669 ADD CONSTRAINT "$2" FOREIGN KEY (locales_id) REFERENCES locales(locales_id) ON UPDATE CASCADE ON DELETE RESTRICT; 670 671 672 -- 673 -- TOC entry 67 (OID 214141) 674 -- Name: $1; Type: FK CONSTRAINT; Schema: public; Owner: wifidog 675 -- 676 677 ALTER TABLE ONLY content_group 678 ADD CONSTRAINT "$1" FOREIGN KEY (content_group_id) REFERENCES content(content_id) ON UPDATE CASCADE ON DELETE CASCADE; 679 680 681 -- 682 -- TOC entry 68 (OID 214153) 683 -- Name: $1; Type: FK CONSTRAINT; Schema: public; Owner: wifidog 684 -- 685 686 ALTER TABLE ONLY content_group_element 687 ADD CONSTRAINT "$1" FOREIGN KEY (content_group_element_id) REFERENCES content(content_id) ON UPDATE CASCADE ON DELETE CASCADE; 688 689 690 -- 691 -- TOC entry 69 (OID 214157) 692 -- Name: $2; Type: FK CONSTRAINT; Schema: public; Owner: wifidog 693 -- 694 695 ALTER TABLE ONLY content_group_element 696 ADD CONSTRAINT "$2" FOREIGN KEY (content_group_id) REFERENCES content_group(content_group_id) ON UPDATE CASCADE ON DELETE CASCADE; 697 698 699 -- 700 -- TOC entry 70 (OID 214161) 701 -- Name: $3; Type: FK CONSTRAINT; Schema: public; Owner: wifidog 702 -- 703 704 ALTER TABLE ONLY content_group_element 705 ADD CONSTRAINT "$3" FOREIGN KEY (displayed_content_id) REFERENCES content(content_id) ON UPDATE CASCADE ON DELETE CASCADE; 706 707 708 -- 709 -- TOC entry 71 (OID 214174) 710 -- Name: $1; Type: FK CONSTRAINT; Schema: public; Owner: wifidog 711 -- 712 713 ALTER TABLE ONLY content_group_element_portal_display_log 714 ADD CONSTRAINT "$1" FOREIGN KEY (user_id) REFERENCES users(user_id) ON UPDATE CASCADE ON DELETE CASCADE; 715 716 717 -- 718 -- TOC entry 72 (OID 214178) 719 -- Name: $2; Type: FK CONSTRAINT; Schema: public; Owner: wifidog 720 -- 721 722 ALTER TABLE ONLY content_group_element_portal_display_log 723 ADD CONSTRAINT "$2" FOREIGN KEY (content_group_element_id) REFERENCES content_group_element(content_group_element_id) ON UPDATE CASCADE ON DELETE CASCADE; 724 725 726 -- 727 -- TOC entry 73 (OID 214182) 728 -- Name: $3; Type: FK CONSTRAINT; Schema: public; Owner: wifidog 729 -- 730 731 ALTER TABLE ONLY content_group_element_portal_display_log 732 ADD CONSTRAINT "$3" FOREIGN KEY (node_id) REFERENCES nodes(node_id) ON UPDATE CASCADE ON DELETE CASCADE; 733 734 735 -- 736 -- TOC entry 74 (OID 214194) 737 -- Name: $1; Type: FK CONSTRAINT; Schema: public; Owner: wifidog 738 -- 739 740 ALTER TABLE ONLY user_has_content 741 ADD CONSTRAINT "$1" FOREIGN KEY (user_id) REFERENCES users(user_id) ON UPDATE CASCADE ON DELETE CASCADE; 742 743 744 -- 745 -- TOC entry 75 (OID 214198) 746 -- Name: $2; Type: FK CONSTRAINT; Schema: public; Owner: wifidog 747 -- 748 749 ALTER TABLE ONLY user_has_content 750 ADD CONSTRAINT "$2" FOREIGN KEY (content_id) REFERENCES content(content_id) ON UPDATE CASCADE ON DELETE CASCADE; 751 752 753 -- 754 -- TOC entry 76 (OID 214210) 755 -- Name: $1; Type: FK CONSTRAINT; Schema: public; Owner: wifidog 756 -- 757 758 ALTER TABLE ONLY node_has_content 759 ADD CONSTRAINT "$1" FOREIGN KEY (node_id) REFERENCES nodes(node_id) ON UPDATE CASCADE ON DELETE CASCADE; 760 761 762 -- 763 -- TOC entry 77 (OID 214214) 764 -- Name: $2; Type: FK CONSTRAINT; Schema: public; Owner: wifidog 765 -- 766 767 ALTER TABLE ONLY node_has_content 768 ADD CONSTRAINT "$2" FOREIGN KEY (content_id) REFERENCES content(content_id) ON UPDATE CASCADE ON DELETE CASCADE; 769 770 771 -- 772 -- TOC entry 78 (OID 214226) 773 -- Name: $1; Type: FK CONSTRAINT; Schema: public; Owner: wifidog 774 -- 775 776 ALTER TABLE ONLY network_has_content 777 ADD CONSTRAINT "$1" FOREIGN KEY (content_id) REFERENCES content(content_id) ON UPDATE CASCADE ON DELETE CASCADE; 778 779 780 -- 781 -- TOC entry 79 (OID 214279) 782 -- Name: $1; Type: FK CONSTRAINT; Schema: public; Owner: wifidog 783 -- 784 785 ALTER TABLE ONLY content_group_element_has_allowed_nodes 786 ADD CONSTRAINT "$1" FOREIGN KEY (content_group_element_id) REFERENCES content_group_element(content_group_element_id) ON UPDATE CASCADE ON DELETE CASCADE; 787 788 789 -- 790 -- TOC entry 80 (OID 214283) 791 -- Name: $2; Type: FK CONSTRAINT; Schema: public; Owner: wifidog 792 -- 793 794 ALTER TABLE ONLY content_group_element_has_allowed_nodes 795 ADD CONSTRAINT "$2" FOREIGN KEY (node_id) REFERENCES nodes(node_id) ON UPDATE CASCADE ON DELETE CASCADE; 796 797 798 -- 340 799 -- TOC entry 3 (OID 2200) 341 800 -- Name: SCHEMA public; Type: COMMENT; Schema: -; Owner: postgres -
trunk/wifidog-auth/wifidog/admin/admin_common.php
r400 r545 27 27 require_once BASEPATH.'classes/Security.php'; 28 28 29 $security = new Security();30 $security->requireAdmin();31 29 ?> -
trunk/wifidog-auth/wifidog/admin/hotspot.php
r512 r545 25 25 define('BASEPATH','../'); 26 26 require_once 'admin_common.php'; 27 28 $security = new Security(); 29 $security->requireAdmin(); 30 27 31 require_once BASEPATH.'classes/Node.php'; 28 32 require_once BASEPATH.'classes/User.php'; -
trunk/wifidog-auth/wifidog/admin/hotspot_log.php
r401 r545 25 25 define('BASEPATH','../'); 26 26 require_once 'admin_common.php'; 27 28 $security = new Security(); 29 $security->requireAdmin(); 27 30 28 31 $db->ExecSql("SELECT node_id, name, (NOW()-last_heartbeat_timestamp) AS since_last_heartbeat, last_heartbeat_ip, CASE WHEN ((NOW()-last_heartbeat_timestamp) < interval '5 minutes') THEN true ELSE false END AS is_up, creation_date FROM nodes ORDER BY node_id", $node_results, false); -
trunk/wifidog-auth/wifidog/admin/hotspot_owner.php
r512 r545 27 27 define('BASEPATH','../'); 28 28 require_once 'admin_common.php'; 29 30 $security = new Security(); 31 $security->requireAdmin(); 32 29 33 require_once BASEPATH.'classes/Node.php'; 30 34 require_once BASEPATH.'classes/User.php'; -
trunk/wifidog-auth/wifidog/admin/import_user_database.php
r512 r545 24 24 define('BASEPATH','../'); 25 25 require_once 'admin_common.php'; 26 27 $security = new Security(); 28 $security->requireAdmin(); 26 29 27 30 /** Affiche les informations sur le fichier envoy� par le client -
trunk/wifidog-auth/wifidog/admin/index.php
r398 r545 25 25 define('BASEPATH','../'); 26 26 require_once 'admin_common.php'; 27 require_once BASEPATH.'classes/Content.php'; 27 28 28 29 $smarty->display("admin/templates/main.html"); -
trunk/wifidog-auth/wifidog/admin/online_users.php
r409 r545 26 26 require_once BASEPATH.'classes/Node.php'; 27 27 28 $security = new Security(); 29 $security->requireAdmin(); 30 28 31 try { 29 32 $online_users = Node::getAllOnlineUsers(); -
trunk/wifidog-auth/wifidog/admin/templates/main.html
r394 r545 1 1 {include file="templates/header.html"} 2 2 3 {"For now, you need to be logged in at a hotspot or to fake a login from one of the HotSpot login pages to have your administrative clearance recognised."|_}4 3 <ul> 5 4 <li><a href='user_log.php'>{"User logs"|_}</a></li> … … 10 9 <li><a href='hotspot.php'>{"Hotspot creation and configuration"|_}</a> - Beta</li> 11 10 <li><a href='owner_sendfiles.php'>{"Hotspot owner administration"|_}</a> - Beta</li> 11 <li><a href='content_admin.php'>{"Content administration"|_}</a> - Beta</li> 12 12 </ul> 13 13 -
trunk/wifidog-auth/wifidog/admin/user_log.php
r516 r545 25 25 define('BASEPATH', '../'); 26 26 require_once 'admin_common.php'; 27 28 $security = new Security(); 29 $security->requireAdmin(); 30 27 31 require_once BASEPATH.'classes/User.php'; 28 32 -
trunk/wifidog-auth/wifidog/admin/user_stats.php
r411 r545 25 25 define('BASEPATH','../'); 26 26 require_once 'admin_common.php'; 27 28 $security = new Security(); 29 $security->requireAdmin(); 30 27 31 require_once BASEPATH.'classes/Statistics.php'; 28 32 -
trunk/wifidog-auth/wifidog/classes/AbstractDbPostgres.php
r402 r545 317 317 echo "<p>ExecuterSqlUpdate(): DEBUG: ".pg_affected_rows($result)." rang�e(s) affect�e(s)</p><hr />\n"; 318 318 } 319 return $result;320 }319 } 320 return $result; 321 321 } 322 322 -
trunk/wifidog-auth/wifidog/classes/Node.php
r516 r545 99 99 $this->mRow = $row; 100 100 $this->mId = $row['node_id']; 101 } //End class101 } 102 102 103 103 /** Return the name of the node -
trunk/wifidog-auth/wifidog/classes/Security.php
r516 r545 28 28 */ 29 29 class Security { 30 var$session;30 private $session; 31 31 32 32 function Security() { -
trunk/wifidog-auth/wifidog/classes/User.php
r532 r545 41 41 return $object; 42 42 } 43 43 44 /** Instantiate the current user 45 * @return a User object, or null if there was an error 46 */ 47 public static function getCurrentUser() 48 { 49 require_once BASEPATH.'classes/Session.php'; 50 $session = new Session(); 51 $user=null; 52 try 53 { 54 $user = new User($session->get(SESS_USER_ID_VAR)); 55 } 56 catch(Exception $e) 57 { 58 /**If any problem occurs, the user should be considered logged out*/ 59 $session->set(SESS_USER_ID_VAR, null); 60 } 61 return $user; 62 } 63 44 64 /** Instantiate a user object 45 65 * @param $username The username of the user … … 240 260 } 241 261 262 /**What locale (language) does the user prefer? 263 * @todo Save in the database */ 264 public function getPreferedLocale() 265 { 266 global $session; 267 //return $this->mRow['prefered_locale']; 268 $locale = $session->get('SESS_LANGUAGE_VAR'); 269 if(empty($locale)) 270 { 271 $locale=DEFAULT_LANG; 272 } 273 return $locale; 274 } 275 242 276 public function getPasswordHash() 243 277 { -
trunk/wifidog-auth/wifidog/config.php
r530 r545 7 7 * 8 8 * $Log$ 9 * Revision 1.31 2005/04/14 15:12:35 benoitg 10 * 2005-04-14 Benoit Gr�goire <bock@step.polymtl.ca> 11 * * First part of the future content delivery infrastructure. Many files added. 12 * 9 13 * Revision 1.30 2005/04/01 21:38:23 fproulx 10 14 * 2005-04-01 Francois Proulx <francois.proulx@gmail.com> … … 225 229 define('DEFAULT_NODE_ID', 'default'); 226 230 define('DEFAULT_LANG', 'fr_FR'); 227 228 /*** FOR TESTING ONLY *** UNCOMMENT THE NEXT LINES 229 *** WHEN READY TO TEST ************************** 230 *** This code define two (2) global variables: 231 *** HTTP_HEADER_LANG will return the language of the 232 *** user's browser stripped from its country code. For 233 *** instance, if the HTTP_ACCEPT_LANGUAGE header is 234 *** something like 'en-ca, en-us, en, fr-ca, fr', the 235 *** first two characters is picked and used as language 236 *** selector. 237 *** The other global variable is the FILE_NAME_SUFFIX. 238 *** for english it is empty, for any other language it is 239 *** the two character code used to set the language. When 240 *** choosing the template (let's say login.html), we simply 241 *** have to replace in the code and add 242 *** "login.html".$FILE_NAME_SUFFIX to get the right 243 *** template (assuming that login.html.fr exists for 244 *** French). 245 if (if (substr($_SERVER["HTTP_ACCEPT_LANGUAGE"],0,2) == "en") { 246 define('HTTP_HEADER_LANG', 'en'); 247 define('FILE_NAME_SUFFIX', ''); 248 } else { 249 define('HTTP_HEADER_LANG', substr($_SERVER["HTTP_ACCEPT_LANGUAGE"],0,2)); 250 define('FILE_NAME_SUFFIX', substr($_SERVER["HTTP_ACCEPT_LANGUAGE"],0,2)); 251 } 252 253 */ 231 232 254 233 } 255 234 ?> -
trunk/wifidog-auth/wifidog/include/common_interface.php
r530 r545 42 42 try 43 43 { 44 $current_user = new User($session->get(SESS_USER_ID_VAR)); 45 $smarty->assign("auth_user", $current_user->getUsername()); 44 $username = null; 45 $current_user = User::getCurrentUser(); 46 if($current_user!=null) 47 {$username=$current_user->getUsername(); 48 } 49 50 $smarty->assign("auth_user", $username); 46 51 } 47 52 catch (Exception $e) -
trunk/wifidog-auth/wifidog/include/schema_validate.php
r534 r545 29 29 require_once BASEPATH.'classes/AbstractDb.php'; 30 30 require_once BASEPATH.'classes/Session.php'; 31 define('REQUIRED_SCHEMA_VERSION', 5);31 define('REQUIRED_SCHEMA_VERSION', 6); 32 32 33 33 /** Check that the database schema is up to date. If it isn't, offer to update it. */ … … 123 123 $schema_version = $row['value']; 124 124 $sql = ''; 125 if ($schema_version < 2) 126 { 127 $new_schema_version = 2; 128 echo "<h2>Preparing SQL statements to update schema to version $new_schema_version</h2>"; 129 $sql .= "UPDATE schema_info SET value='$new_schema_version' WHERE tag='schema_version';\n"; 125 $new_schema_version = 2; 126 if ($schema_version < $new_schema_version) 127 { 128 129 echo "<h2>Preparing SQL statements to update schema to version $new_schema_version</h2>"; 130 $sql .= "\n\nUPDATE schema_info SET value='$new_schema_version' WHERE tag='schema_version';\n"; 130 131 $sql .= "ALTER TABLE users ADD COLUMN username text;\n"; 131 132 $sql .= "ALTER TABLE users ADD COLUMN account_origin text;\n"; … … 139 140 $sql .= "CREATE UNIQUE INDEX idx_unique_email_and_account_origin ON users USING btree (email, account_origin);\n"; 140 141 } 141 else 142 if ($schema_version < 3) 143 { 144 $new_schema_version = 3; 145 echo "<h2>Preparing SQL statements to update schema to version $new_schema_version</h2>"; 146 $sql .= "UPDATE schema_info SET value='$new_schema_version' WHERE tag='schema_version';\n"; 147 $sql .= "DROP INDEX idx_unique_email_and_account_origin;\n"; 148 $sql .= "ALTER TABLE users DROP CONSTRAINT check_email_not_empty;\n"; 149 } // $db -> ExecSqlUpdate("BEGIN;\n$sql\nROLLBACK;\n", true); 150 151 else 152 if ($schema_version < 4) 153 { 154 $new_schema_version = 4; 155 echo "<h2>Preparing SQL statements to update schema to version $new_schema_version</h2>"; 156 $sql .= "UPDATE schema_info SET value='$new_schema_version' WHERE tag='schema_version';\n"; 157 $sql .= "ALTER TABLE users ALTER COLUMN account_origin SET NOT NULL;\n"; 158 $sql .= "ALTER TABLE users ADD CONSTRAINT check_account_origin_not_empty CHECK (account_origin::text <> ''::text);\n"; 159 } 160 else 161 if ($schema_version < 5) 162 { 163 $new_schema_version = 5; 164 echo "<h1>Recoding database from ISO-8859-1 to UTF-8</h1>"; 165 echo "<h1>YOU MUST EXECUTE THESE COMMANDS IN COMMAND_LINE</h1>"; 166 echo "pg_dump wifidog -U wifidog > wifidog_dump.sql<br>"; 167 echo "dropdb wifidog -U wifidog <br>"; 168 echo "createdb --encoding=UNICODE --template = template0 -U wifidog wifidog<br>"; 169 echo "psql wifidog -U wifidog < wifidog_dump.sql<br><br>"; 170 echo "THEN use psql to modify to schema_version manually<br><br>"; 171 echo "UPDATE schema_info SET value='$new_schema_version' WHERE tag='schema_version'<p>"; 172 exit; 173 } 142 143 $new_schema_version = 3; 144 if ($schema_version < $new_schema_version) 145 { 146 echo "<h2>Preparing SQL statements to update schema to version $new_schema_version</h2>"; 147 $sql .= "\n\nUPDATE schema_info SET value='$new_schema_version' WHERE tag='schema_version';\n"; 148 $sql .= "DROP INDEX idx_unique_email_and_account_origin;\n"; 149 $sql .= "ALTER TABLE users DROP CONSTRAINT check_email_not_empty;\n"; 150 } 151 152 $new_schema_version = 4; 153 if ($schema_version < $new_schema_version) 154 { 155 echo "<h2>Preparing SQL statements to update schema to version $new_schema_version</h2>"; 156 $sql .= "\n\nUPDATE schema_info SET value='$new_schema_version' WHERE tag='schema_version';\n"; 157 $sql .= "ALTER TABLE users ALTER COLUMN account_origin SET NOT NULL;\n"; 158 $sql .= "ALTER TABLE users ADD CONSTRAINT check_account_origin_not_empty CHECK (account_origin::text <> ''::text);\n"; 159 160 //We must skip all other updates because schema 5 must be manually updated: 161 $schema_version = 1000000; 162 } 163 164 $new_schema_version = 5; 165 if ($schema_version == $new_schema_version -1) 166 { 167 echo "<h1>Recoding database from ISO-8859-1 to UTF-8</h1>"; 168 echo "<h1>YOU MUST EXECUTE THESE COMMANDS FROM THE COMMAND_LINE:</h1>"; 169 echo "pg_dump wifidog -U wifidog > wifidog_dump.sql;<br>"; 170 echo "dropdb wifidog -U wifidog; <br>"; 171 echo "createdb --encoding=UNICODE --template=template0 -U wifidog wifidog;<br>"; 172 echo "psql wifidog -U wifidog < wifidog_dump.sql;<br>\n"; 173 echo " (Note: You may ignore the following errors: \"ERROR: permission denied to set session authorization\" and \"ERROR: must be owner of schema public\")<br>"; 174 echo "psql wifidog -U wifidog -c \"UPDATE schema_info SET value='$new_schema_version' WHERE tag='schema_version'\";<br>"; 175 exit; 176 } 177 $new_schema_version = 6; 178 if ($schema_version < $new_schema_version) 179 { 180 181 echo "<h2>Preparing SQL statements to update schema to version $new_schema_version</h2>"; 182 $sql .= "\n\nUPDATE schema_info SET value='$new_schema_version' WHERE tag='schema_version';\n"; 183 $sql .= "CREATE TABLE locales ( \n"; 184 $sql .= " locales_id text PRIMARY KEY \n"; 185 $sql .= " ); \n"; 186 $sql .= " INSERT INTO locales VALUES ('fr'); \n"; 187 $sql .= " INSERT INTO locales VALUES ('en'); \n"; 188 $sql .= "ALTER TABLE users ADD COLUMN never_show_username bool;\n"; 189 $sql .= "ALTER TABLE users ALTER COLUMN never_show_username SET DEFAULT FALSE;\n"; 190 $sql .= "ALTER TABLE users ADD COLUMN real_name text;\n"; 191 $sql .= "ALTER TABLE users ALTER COLUMN real_name SET DEFAULT NULL;\n"; 192 $sql .= "ALTER TABLE users ADD COLUMN website text;\n"; 193 $sql .= "ALTER TABLE users ALTER COLUMN website SET DEFAULT NULL;\n"; 194 $sql .= "ALTER TABLE users ADD COLUMN prefered_locale text REFERENCES locales ON DELETE SET NULL ON UPDATE CASCADE;\n"; 195 196 $sql .= " 197 CREATE TABLE content 198 ( 199 content_id text NOT NULL PRIMARY KEY, 200 content_type text NOT NULL CONSTRAINT content_type_not_empty_string CHECK (content_type != ''), 201 title text REFERENCES content ON DELETE RESTRICT ON UPDATE CASCADE, 202 description text REFERENCES content ON DELETE RESTRICT ON UPDATE CASCADE, 203 project_info text REFERENCES content ON DELETE RESTRICT ON UPDATE CASCADE, 204 sponsor_info text REFERENCES content ON DELETE RESTRICT ON UPDATE CASCADE, 205 creation_timestamp timestamp DEFAULT now() 206 ); 207 208 CREATE TABLE content_has_owners 209 ( 210 content_id text NOT NULL REFERENCES content ON DELETE CASCADE ON UPDATE CASCADE, 211 user_id text NOT NULL REFERENCES users ON DELETE CASCADE ON UPDATE CASCADE, 212 is_author bool NOT NULL, 213 owner_since timestamp DEFAULT now(), 214 PRIMARY KEY (content_id, user_id) 215 ); 216 217 CREATE TABLE langstring_entries ( 218 langstring_entries_id text NOT NULL PRIMARY KEY, 219 langstrings_id text REFERENCES content ON DELETE CASCADE ON UPDATE CASCADE, 220 locales_id text REFERENCES locales ON DELETE RESTRICT ON UPDATE CASCADE, 221 value text DEFAULT '' 222 ); 223 224 CREATE TABLE content_group ( 225 content_group_id text NOT NULL PRIMARY KEY REFERENCES content ON DELETE CASCADE ON UPDATE CASCADE, 226 is_artistic_content bool NOT NULL DEFAULT FALSE, 227 is_locative_content bool NOT NULL DEFAULT FALSE, 228 content_selection_mode text 229 ); 230 231 CREATE TABLE content_group_element ( 232 content_group_element_id text NOT NULL PRIMARY KEY REFERENCES content ON DELETE CASCADE ON UPDATE CASCADE, 233 content_group_id text NOT NULL REFERENCES content_group ON DELETE CASCADE ON UPDATE CASCADE, 234 display_order integer DEFAULT '1', 235 displayed_content_id text REFERENCES content ON DELETE CASCADE ON UPDATE CASCADE, 236 force_only_allowed_node bool 237 ); 238 CREATE INDEX idx_content_group_element_content_group_id ON content_group_element (content_group_id); 239 240 CREATE TABLE content_group_element_has_allowed_nodes 241 ( 242 content_group_element_id text NOT NULL REFERENCES content_group_element ON DELETE CASCADE ON UPDATE CASCADE, 243 node_id text NOT NULL REFERENCES nodes ON DELETE CASCADE ON UPDATE CASCADE, 244 allowed_since timestamp DEFAULT now(), 245 PRIMARY KEY (content_group_element_id, node_id) 246 ); 247 248 CREATE TABLE content_group_element_portal_display_log ( 249 user_id text NOT NULL REFERENCES users ON DELETE CASCADE ON UPDATE CASCADE, 250 content_group_element_id text NOT NULL REFERENCES content_group_element ON DELETE CASCADE ON UPDATE CASCADE, 251 display_timestamp timestamp NOT NULL DEFAULT now(), 252 node_id text REFERENCES nodes ON DELETE CASCADE ON UPDATE CASCADE, 253 PRIMARY KEY (user_id,content_group_element_id, display_timestamp) 254 ); 255 256 CREATE TABLE user_has_content ( 257 user_id text NOT NULL REFERENCES users ON DELETE CASCADE ON UPDATE CASCADE, 258 content_id text NOT NULL REFERENCES content ON DELETE CASCADE ON UPDATE CASCADE, 259 subscribe_timestamp timestamp NOT NULL DEFAULT now(), 260 PRIMARY KEY (user_id,content_id) 261 ); 262 263 CREATE TABLE node_has_content ( 264 node_id text NOT NULL REFERENCES nodes ON DELETE CASCADE ON UPDATE CASCADE, 265 content_id text NOT NULL REFERENCES content ON DELETE CASCADE ON UPDATE CASCADE, 266 subscribe_timestamp timestamp NOT NULL DEFAULT now(), 267 PRIMARY KEY (node_id,content_id) 268 ); 269 270 CREATE TABLE network_has_content ( 271 network_id text NOT NULL, 272 content_id text NOT NULL REFERENCES content ON DELETE CASCADE ON UPDATE CASCADE, 273 subscribe_timestamp timestamp NOT NULL DEFAULT now(), 274 PRIMARY KEY (network_id,content_id) 275 );"; 276 } 277 278 /* 279 $new_schema_version = 7; 280 if ($schema_version < $new_schema_version) 281 { 282 283 echo "<h2>Preparing SQL statements to update schema to version $new_schema_version</h2>"; 284 $sql .= "\n\nUPDATE schema_info SET value='$new_schema_version' WHERE tag='schema_version';\n"; 285 } 286 */ 174 287 $db->ExecSqlUpdate("BEGIN;\n$sql\nCOMMIT;\n", true); 175 288 echo "</html></head>"; … … 178 291 } 179 292 ?> 293 294 -
trunk/wifidog-auth/wifidog/local_content/default/stylesheet.css
r452 r545 163 163 #std_table td.item { font-weight: bold; } 164 164 165 /* The content container */ 166 .content { border: 2px solid gray; 167 width:auto;} 168 /* The admin container */ 169 .admin_container { border: 1px solid grey; 170 margin: 3px; 171 width:auto; } 172 /* The class name of the container */ 173 .admin_class { /*float: left;*/ 174 color:grey; 175 border: none; 176 display: none; 177 } 178 .admin_section_container { border: 2px solid blue; 179 margin: 3px; 180 width:auto; } 181 .admin_section_title { font-weight: bold; } 182 .admin_section_tools { clear: none;} 183 184 .user_ui_container{ border: none; } 185 .user_ui_object_class{ display: none; } 165 186 {/literal}
