Changeset 685
- Timestamp:
- 08/12/05 16:30:46 (8 years ago)
- Location:
- trunk/wifidog-auth
- Files:
-
- 3 added
- 2 removed
- 11 modified
-
ChangeLog (modified) (1 diff)
-
INSTALL (modified) (1 diff)
-
TODO (modified) (1 diff)
-
sql/wifidog-postgres-initial-data.sql (modified) (9 diffs)
-
sql/wifidog-postgres-schema.sql (modified) (20 diffs)
-
wifidog/classes/Content/HotspotRss.php (deleted)
-
wifidog/classes/Content/RssAggregator.php (added)
-
wifidog/classes/MainUI.php (modified) (2 diffs)
-
wifidog/classes/Node.php (modified) (43 diffs)
-
wifidog/classes/RssPressReview.inc (deleted)
-
wifidog/config.php (modified) (1 diff)
-
wifidog/include/common.php (modified) (1 diff)
-
wifidog/include/schema_validate.php (modified) (2 diffs)
-
wifidog/lib/RssPressReview (added)
-
wifidog/lib/RssPressReview/RssPressReview.php (added)
-
wifidog/local_content/default/stylesheet.css (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/wifidog-auth/ChangeLog
r684 r685 1 2005-08-12 Benoit Grégoire <bock@step.polymtl.ca> 2 * classes/MainUI.php: Move the call to schema_validate() in MainUI's constructor 3 * lib/RssPressReview/RssPressReview.php: Finish rewrite. Move there to reflect 4 it's independently maintained status 5 * wifidog/classes/Content/HotspotRss.php: Delete the class, obsolete 6 * wifidog/classes/Content/RssAggregator.php: Functionnal, but needs it's admin UI written. 7 * wifidog/include/schema_validate.php: Create the table structure for the new RssAggregator. 8 Remove rss_url in nodes table, no longer needed. Move it's data to the new Content class. 9 1 10 2005-08-11 Francois Proulx <francois.proulx@gmail.com> 2 11 * Refactored the Admin UI. -
trunk/wifidog-auth/INSTALL
r530 r685 15 15 -Copy the content of the magpierss-0.xx directory of the magpierss tarball in lib/magpie. If you do not wish to install RSS support, you must set define('RSS_SUPPORT', false) in config.php. 16 16 17 - local_content/cache/, and everything in tmp/smarty must be at least writable by your web server. Run "sh permissions.sh" to set them 77717 -portal/cache/, and everything in tmp/smarty must be at least writable by your web server. Run "sh permissions.sh" to set them 777 18 18 19 19 Database: -
trunk/wifidog-auth/TODO
r655 r685 18 18 spamgourmet.com 19 19 spammotel.com 20 dodgeit.com 20 21 21 22 -Make error messages much more visible, especially in lost password. -
trunk/wifidog-auth/sql/wifidog-postgres-initial-data.sql
r606 r685 7 7 SET client_encoding = 'UNICODE'; 8 8 SET check_function_bodies = false; 9 10 SET SESSION AUTHORIZATION 'wifidog'; 9 SET client_min_messages = warning; 11 10 12 11 SET search_path = public, pg_catalog; 13 12 14 13 -- 15 -- Data for TOC entry 2 (OID 706682) 16 -- Name: token_status; Type: TABLE DATA; Schema: public; Owner: wifidog 14 -- Data for Name: token_status; Type: TABLE DATA; Schema: public; Owner: wifidog 17 15 -- 18 16 … … 23 21 24 22 -- 23 -- PostgreSQL database dump complete 24 -- 25 26 -- 25 27 -- PostgreSQL database dump 26 28 -- … … 28 30 SET client_encoding = 'UNICODE'; 29 31 SET check_function_bodies = false; 30 31 SET SESSION AUTHORIZATION 'wifidog'; 32 SET client_min_messages = warning; 32 33 33 34 SET search_path = public, pg_catalog; 34 35 35 36 -- 36 -- Data for TOC entry 2 (OID 706717) 37 -- Name: venue_types; Type: TABLE DATA; Schema: public; Owner: wifidog 37 -- Data for Name: venue_types; Type: TABLE DATA; Schema: public; Owner: wifidog 38 38 -- 39 39 … … 75 75 76 76 -- 77 -- PostgreSQL database dump complete 78 -- 79 80 -- 77 81 -- PostgreSQL database dump 78 82 -- … … 80 84 SET client_encoding = 'UNICODE'; 81 85 SET check_function_bodies = false; 82 83 SET SESSION AUTHORIZATION 'wifidog'; 86 SET client_min_messages = warning; 84 87 85 88 SET search_path = public, pg_catalog; 86 89 87 90 -- 88 -- Data for TOC entry 2 (OID 706715) 89 -- Name: node_deployment_status; Type: TABLE DATA; Schema: public; Owner: wifidog 91 -- Data for Name: node_deployment_status; Type: TABLE DATA; Schema: public; Owner: wifidog 90 92 -- 91 93 … … 98 100 99 101 102 -- 103 -- PostgreSQL database dump complete 104 -- 105 100 106 INSERT INTO nodes (node_id, name, rss_url) VALUES ('default', 'Unknown node', NULL); 101 107 -- … … 105 111 SET client_encoding = 'UNICODE'; 106 112 SET check_function_bodies = false; 107 108 SET SESSION AUTHORIZATION 'wifidog'; 113 SET client_min_messages = warning; 109 114 110 115 SET search_path = public, pg_catalog; 111 116 112 117 -- 113 -- Data for TOC entry 2 (OID 706727) 114 -- Name: schema_info; Type: TABLE DATA; Schema: public; Owner: wifidog 118 -- Data for Name: schema_info; Type: TABLE DATA; Schema: public; Owner: wifidog 115 119 -- 116 120 117 INSERT INTO schema_info (tag, value) VALUES ('schema_version', ' 13');121 INSERT INTO schema_info (tag, value) VALUES ('schema_version', '21'); 118 122 123 124 -- 125 -- PostgreSQL database dump complete 126 -- 119 127 120 128 -- … … 124 132 SET client_encoding = 'UNICODE'; 125 133 SET check_function_bodies = false; 126 127 SET SESSION AUTHORIZATION 'wifidog'; 134 SET client_min_messages = warning; 128 135 129 136 SET search_path = public, pg_catalog; 130 137 131 138 -- 132 -- Data for TOC entry 2 (OID 728649) 133 -- Name: locales; Type: TABLE DATA; Schema: public; Owner: wifidog 139 -- Data for Name: locales; Type: TABLE DATA; Schema: public; Owner: wifidog 134 140 -- 135 141 … … 138 144 139 145 146 -- 147 -- PostgreSQL database dump complete 148 -- 149 140 150 COMMIT; -
trunk/wifidog-auth/sql/wifidog-postgres-schema.sql
r606 r685 5 5 SET client_encoding = 'UNICODE'; 6 6 SET check_function_bodies = false; 7 8 -- 9 -- TOC entry 2 (OID 0)7 SET client_min_messages = warning; 8 9 -- 10 10 -- Name: wifidog; Type: DATABASE; Schema: -; Owner: wifidog 11 11 -- … … 14 14 15 15 16 \connect wifidog wifidog16 \connect wifidog 17 17 18 18 SET client_encoding = 'UNICODE'; 19 19 SET check_function_bodies = false; 20 SET client_min_messages = warning; 21 22 -- 23 -- Name: SCHEMA public; Type: COMMENT; Schema: -; Owner: postgres 24 -- 25 26 COMMENT ON SCHEMA public IS 'Standard public schema'; 27 20 28 21 29 SET search_path = public, pg_catalog; 22 30 23 -- 24 -- TOC entry 5 (OID 706679) 25 -- Name: administrators; Type: TABLE; Schema: public; Owner: wifidog 31 SET default_tablespace = ''; 32 33 SET default_with_oids = true; 34 35 -- 36 -- Name: administrators; Type: TABLE; Schema: public; Owner: wifidog; Tablespace: 26 37 -- 27 38 … … 32 43 33 44 -- 34 -- TOC entry 6 (OID 706682) 35 -- Name: token_status; Type: TABLE; Schema: public; Owner: wifidog 36 -- 37 38 CREATE TABLE token_status ( 39 token_status character varying(10) NOT NULL 40 ); 41 42 43 -- 44 -- TOC entry 7 (OID 706686) 45 -- Name: connections; Type: TABLE; Schema: public; Owner: wifidog 45 -- Name: connections; Type: TABLE; Schema: public; Owner: wifidog; Tablespace: 46 46 -- 47 47 … … 64 64 65 65 -- 66 -- TOC entry 8 (OID 706692) 67 -- Name: nodes; Type: TABLE; Schema: public; Owner: wifidog 68 -- 69 70 CREATE TABLE nodes ( 71 node_id character varying(32) DEFAULT ''::character varying NOT NULL, 72 name text, 73 rss_url text, 74 last_heartbeat_ip character varying(16), 75 last_heartbeat_timestamp timestamp without time zone DEFAULT now(), 76 creation_date date DEFAULT now(), 77 home_page_url text, 78 last_heartbeat_user_agent text, 79 description text, 80 map_url text, 81 street_address text, 82 public_phone_number text, 83 public_email text, 84 mass_transit_info text, 85 node_deployment_status character varying(32) DEFAULT 'IN_PLANNING'::character varying NOT NULL, 86 venue_type text DEFAULT 'Other'::text 87 ); 88 89 90 -- 91 -- TOC entry 9 (OID 706702) 92 -- Name: users; Type: TABLE; Schema: public; Owner: wifidog 93 -- 94 95 CREATE TABLE users ( 96 user_id character varying(45) NOT NULL, 97 pass character varying(32) DEFAULT ''::character varying NOT NULL, 98 email character varying(255) DEFAULT ''::character varying NOT NULL, 99 account_status integer, 100 validation_token character varying(64) DEFAULT ''::character varying NOT NULL, 101 reg_date timestamp without time zone DEFAULT now() NOT NULL, 102 username text, 103 account_origin text NOT NULL, 104 never_show_username boolean DEFAULT false, 105 real_name text, 106 website text, 107 prefered_locale text, 108 CONSTRAINT check_account_origin_not_empty CHECK ((account_origin <> ''::text)), 109 CONSTRAINT check_user_not_empty CHECK (((user_id)::text <> ''::text)) 110 ); 111 112 113 -- 114 -- TOC entry 10 (OID 706713) 115 -- Name: node_owners; Type: TABLE; Schema: public; Owner: wifidog 116 -- 117 118 CREATE TABLE node_owners ( 119 node_id character varying(32) NOT NULL, 120 user_id character varying(45) NOT NULL 121 ) WITHOUT OIDS; 122 123 124 -- 125 -- TOC entry 11 (OID 706715) 126 -- Name: node_deployment_status; Type: TABLE; Schema: public; Owner: wifidog 127 -- 128 129 CREATE TABLE node_deployment_status ( 130 node_deployment_status character varying(32) NOT NULL 131 ) WITHOUT OIDS; 132 133 134 -- 135 -- TOC entry 12 (OID 706717) 136 -- Name: venue_types; Type: TABLE; Schema: public; Owner: wifidog 137 -- 138 139 CREATE TABLE venue_types ( 140 venue_type text NOT NULL 141 ) WITHOUT OIDS; 142 143 144 -- 145 -- TOC entry 13 (OID 706722) 146 -- Name: venues; Type: TABLE; Schema: public; Owner: wifidog 147 -- 148 149 CREATE TABLE venues ( 150 name text NOT NULL, 151 description text 152 ) WITHOUT OIDS; 153 154 155 -- 156 -- TOC entry 14 (OID 706727) 157 -- Name: schema_info; Type: TABLE; Schema: public; Owner: wifidog 158 -- 159 160 CREATE TABLE schema_info ( 161 tag text NOT NULL, 162 value text 163 ); 164 165 166 -- 167 -- TOC entry 15 (OID 728649) 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 728663) 178 -- Name: content; Type: TABLE; Schema: public; Owner: wifidog 66 -- Name: content; Type: TABLE; Schema: public; Owner: wifidog; Tablespace: 179 67 -- 180 68 … … 188 76 creation_timestamp timestamp without time zone DEFAULT now(), 189 77 is_persistent boolean DEFAULT false, 78 long_description text, 190 79 CONSTRAINT content_type_not_empty_string CHECK ((content_type <> ''::text)) 191 80 ); … … 193 82 194 83 -- 195 -- TOC entry 17 (OID 728688)196 -- Name: content_has_owners; Type: TABLE; Schema: public; Owner: wifidog197 -- 198 199 CREATE TABLE content_has_owners ( 84 -- Name: content_display_log; Type: TABLE; Schema: public; Owner: wifidog; Tablespace: 85 -- 86 87 CREATE TABLE content_display_log ( 88 user_id text NOT NULL, 200 89 content_id text NOT NULL, 201 user_id text NOT NULL, 202 is_author boolean NOT NULL, 203 owner_since timestamp without time zone DEFAULT now() 204 ); 205 206 207 -- 208 -- TOC entry 18 (OID 728704) 209 -- Name: langstring_entries; Type: TABLE; Schema: public; Owner: wifidog 210 -- 211 212 CREATE TABLE langstring_entries ( 213 langstring_entries_id text NOT NULL, 214 langstrings_id text, 215 locales_id text, 216 value text DEFAULT ''::text 217 ); 218 219 220 -- 221 -- TOC entry 19 (OID 728720) 222 -- Name: content_group; Type: TABLE; Schema: public; Owner: wifidog 90 first_display_timestamp timestamp without time zone DEFAULT now() NOT NULL, 91 node_id text NOT NULL, 92 last_display_timestamp timestamp without time zone DEFAULT now() NOT NULL 93 ); 94 95 96 -- 97 -- Name: content_group; Type: TABLE; Schema: public; Owner: wifidog; Tablespace: 223 98 -- 224 99 … … 236 111 237 112 -- 238 -- TOC entry 20 (OID 728733) 239 -- Name: content_group_element; Type: TABLE; Schema: public; Owner: wifidog 113 -- Name: content_group_element; Type: TABLE; Schema: public; Owner: wifidog; Tablespace: 240 114 -- 241 115 … … 250 124 251 125 -- 252 -- TOC entry 21 (OID 728754) 253 -- Name: content_group_element_has_allowed_nodes; Type: TABLE; Schema: public; Owner: wifidog 126 -- Name: content_group_element_has_allowed_nodes; Type: TABLE; Schema: public; Owner: wifidog; Tablespace: 254 127 -- 255 128 … … 262 135 263 136 -- 264 -- TOC entry 22 (OID 728790)265 -- Name: user_has_content; Type: TABLE; Schema: public; Owner: wifidog266 -- 267 268 CREATE TABLE user_has_content ( 137 -- Name: content_has_owners; Type: TABLE; Schema: public; Owner: wifidog; Tablespace: 138 -- 139 140 CREATE TABLE content_has_owners ( 141 content_id text NOT NULL, 269 142 user_id text NOT NULL, 143 is_author boolean DEFAULT false NOT NULL, 144 owner_since timestamp without time zone DEFAULT now() 145 ); 146 147 148 -- 149 -- Name: content_rss_aggregator; Type: TABLE; Schema: public; Owner: wifidog; Tablespace: 150 -- 151 152 CREATE TABLE content_rss_aggregator ( 270 153 content_id text NOT NULL, 271 subscribe_timestamp timestamp without time zone DEFAULT now() NOT NULL272 ); 273 274 275 -- 276 -- TOC entry 23 (OID 728806) 277 -- Name: node_has_content; Type: TABLE; Schema: public; Owner: wifidog278 -- 279 280 CREATE TABLE node_has_content ( 281 node_id text NOT NULL, 154 number_of_display_items integer DEFAULT 10 NOT NULL, 155 algorithm_strength real DEFAULT 0.75 NOT NULL, 156 max_item_age interval 157 ); 158 159 160 -- 161 -- Name: content_rss_aggregator_feeds; Type: TABLE; Schema: public; Owner: wifidog; Tablespace: 162 -- 163 164 CREATE TABLE content_rss_aggregator_feeds ( 282 165 content_id text NOT NULL, 283 subscribe_timestamp timestamp without time zone DEFAULT now() NOT NULL 284 ); 285 286 287 -- 288 -- TOC entry 24 (OID 728822) 289 -- Name: network_has_content; Type: TABLE; Schema: public; Owner: wifidog 290 -- 291 292 CREATE TABLE network_has_content ( 293 network_id text NOT NULL, 294 content_id text NOT NULL, 295 subscribe_timestamp timestamp without time zone DEFAULT now() NOT NULL 296 ); 297 298 299 -- 300 -- TOC entry 25 (OID 741741) 301 -- Name: flickr_photostream; Type: TABLE; Schema: public; Owner: wifidog 166 url text NOT NULL, 167 bias real DEFAULT 1 NOT NULL, 168 default_publication_interval integer 169 ); 170 171 172 -- 173 -- Name: embedded_content; Type: TABLE; Schema: public; Owner: wifidog; Tablespace: 174 -- 175 176 CREATE TABLE embedded_content ( 177 embedded_content_id text NOT NULL, 178 embedded_file_id text, 179 fallback_content_id text, 180 parameters text, 181 attributes text 182 ); 183 184 185 -- 186 -- Name: files; Type: TABLE; Schema: public; Owner: wifidog; Tablespace: 187 -- 188 189 CREATE TABLE files ( 190 files_id text NOT NULL, 191 filename text, 192 mime_type text, 193 remote_size bigint, 194 url text, 195 data_blob oid, 196 local_binary_size bigint 197 ); 198 199 200 -- 201 -- Name: flickr_photostream; Type: TABLE; Schema: public; Owner: wifidog; Tablespace: 302 202 -- 303 203 … … 319 219 display_description boolean DEFAULT false NOT NULL, 320 220 display_tags boolean DEFAULT false NOT NULL, 321 preferred_size text 322 ); 323 324 325 -- 326 -- TOC entry 26 (OID 741760) 327 -- Name: files; Type: TABLE; Schema: public; Owner: wifidog 328 -- 329 330 CREATE TABLE files ( 331 files_id text NOT NULL, 332 filename text, 333 mime_type text, 334 binary_data bytea, 335 remote_size bigint, 336 url text 337 ); 338 339 340 -- 341 -- TOC entry 27 (OID 741767) 342 -- Name: embedded_content; Type: TABLE; Schema: public; Owner: wifidog 343 -- 344 345 CREATE TABLE embedded_content ( 346 embedded_content_id text NOT NULL, 347 embedded_file_id text, 348 fallback_content_id text, 349 parameters text, 350 attributes text 351 ); 352 353 354 -- 355 -- TOC entry 28 (OID 741772) 356 -- Name: content_display_log; Type: TABLE; Schema: public; Owner: wifidog 357 -- 358 359 CREATE TABLE content_display_log ( 221 preferred_size text, 222 requests_cache text, 223 cache_update_timestamp timestamp without time zone 224 ); 225 226 227 -- 228 -- Name: iframes; Type: TABLE; Schema: public; Owner: wifidog; Tablespace: 229 -- 230 231 CREATE TABLE iframes ( 232 iframes_id text NOT NULL, 233 url text, 234 width integer, 235 height integer 236 ); 237 238 239 -- 240 -- Name: langstring_entries; Type: TABLE; Schema: public; Owner: wifidog; Tablespace: 241 -- 242 243 CREATE TABLE langstring_entries ( 244 langstring_entries_id text NOT NULL, 245 langstrings_id text, 246 locales_id text, 247 value text DEFAULT ''::text 248 ); 249 250 251 -- 252 -- Name: locales; Type: TABLE; Schema: public; Owner: wifidog; Tablespace: 253 -- 254 255 CREATE TABLE locales ( 256 locales_id text NOT NULL 257 ); 258 259 260 -- 261 -- Name: network_has_content; Type: TABLE; Schema: public; Owner: wifidog; Tablespace: 262 -- 263 264 CREATE TABLE network_has_content ( 265 network_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 SET default_with_oids = false; 272 273 -- 274 -- Name: node_deployment_status; Type: TABLE; Schema: public; Owner: wifidog; Tablespace: 275 -- 276 277 CREATE TABLE node_deployment_status ( 278 node_deployment_status character varying(32) NOT NULL 279 ); 280 281 282 SET default_with_oids = true; 283 284 -- 285 -- Name: node_has_content; Type: TABLE; Schema: public; Owner: wifidog; Tablespace: 286 -- 287 288 CREATE TABLE node_has_content ( 289 node_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 SET default_with_oids = false; 296 297 -- 298 -- Name: node_owners; Type: TABLE; Schema: public; Owner: wifidog; Tablespace: 299 -- 300 301 CREATE TABLE node_owners ( 302 node_id character varying(32) NOT NULL, 303 user_id character varying(45) NOT NULL 304 ); 305 306 307 SET default_with_oids = true; 308 309 -- 310 -- Name: nodes; Type: TABLE; Schema: public; Owner: wifidog; Tablespace: 311 -- 312 313 CREATE TABLE nodes ( 314 node_id character varying(32) DEFAULT ''::character varying NOT NULL, 315 name text, 316 last_heartbeat_ip character varying(16), 317 last_heartbeat_timestamp timestamp without time zone DEFAULT now(), 318 creation_date date DEFAULT now(), 319 home_page_url text, 320 last_heartbeat_user_agent text, 321 description text, 322 map_url text, 323 street_address text, 324 public_phone_number text, 325 public_email text, 326 mass_transit_info text, 327 node_deployment_status character varying(32) DEFAULT 'IN_PLANNING'::character varying NOT NULL, 328 venue_type text DEFAULT 'Other'::text, 329 max_monthly_incoming bigint, 330 max_monthly_outgoing bigint, 331 quota_reset_day_of_month integer, 332 latitude numeric(16,6), 333 longitude numeric(16,6) 334 ); 335 336 337 -- 338 -- Name: pictures; Type: TABLE; Schema: public; Owner: wifidog; Tablespace: 339 -- 340 341 CREATE TABLE pictures ( 342 pictures_id text NOT NULL, 343 width integer, 344 height integer 345 ); 346 347 348 -- 349 -- Name: schema_info; Type: TABLE; Schema: public; Owner: wifidog; Tablespace: 350 -- 351 352 CREATE TABLE schema_info ( 353 tag text NOT NULL, 354 value text 355 ); 356 357 358 -- 359 -- Name: token_status; Type: TABLE; Schema: public; Owner: wifidog; Tablespace: 360 -- 361 362 CREATE TABLE token_status ( 363 token_status character varying(10) NOT NULL 364 ); 365 366 367 -- 368 -- Name: user_has_content; Type: TABLE; Schema: public; Owner: wifidog; Tablespace: 369 -- 370 371 CREATE TABLE user_has_content ( 360 372 user_id text NOT NULL, 361 373 content_id text NOT NULL, 362 first_display_timestamp timestamp without time zone DEFAULT now() NOT NULL, 363 node_id text NOT NULL, 364 last_display_timestamp timestamp without time zone DEFAULT now() NOT NULL 365 ); 366 367 368 -- 369 -- TOC entry 32 (OID 728596) 370 -- Name: idx_token; Type: INDEX; Schema: public; Owner: wifidog 371 -- 372 373 CREATE INDEX idx_token ON connections USING btree (token); 374 375 376 -- 377 -- TOC entry 33 (OID 728597) 378 -- Name: idx_token_status_and_user_id; Type: INDEX; Schema: public; Owner: wifidog 379 -- 380 381 CREATE INDEX idx_token_status_and_user_id ON connections USING btree (token_status, user_id); 382 383 384 -- 385 -- TOC entry 35 (OID 728598) 386 -- Name: idx_unique_username_and_account_origin; Type: INDEX; Schema: public; Owner: wifidog 387 -- 388 389 CREATE UNIQUE INDEX idx_unique_username_and_account_origin ON users USING btree (username, account_origin); 390 391 392 -- 393 -- TOC entry 47 (OID 728753) 394 -- Name: idx_content_group_element_content_group_id; Type: INDEX; Schema: public; Owner: wifidog 395 -- 396 397 CREATE INDEX idx_content_group_element_content_group_id ON content_group_element USING btree (content_group_id); 398 399 400 -- 401 -- TOC entry 29 (OID 728599) 402 -- Name: administrators_pkey; Type: CONSTRAINT; Schema: public; Owner: wifidog 374 subscribe_timestamp timestamp without time zone DEFAULT now() NOT NULL 375 ); 376 377 378 -- 379 -- Name: users; Type: TABLE; Schema: public; Owner: wifidog; Tablespace: 380 -- 381 382 CREATE TABLE users ( 383 user_id character varying(45) NOT NULL, 384 pass character varying(32) DEFAULT ''::character varying NOT NULL, 385 email character varying(255) DEFAULT ''::character varying NOT NULL, 386 account_status integer, 387 validation_token character varying(64) DEFAULT ''::character varying NOT NULL, 388 reg_date timestamp without time zone DEFAULT now() NOT NULL, 389 username text, 390 account_origin text NOT NULL, 391 never_show_username boolean DEFAULT false, 392 real_name text, 393 website text, 394 prefered_locale text, 395 CONSTRAINT check_account_origin_not_empty CHECK ((account_origin <> ''::text)), 396 CONSTRAINT check_user_not_empty CHECK (((user_id)::text <> ''::text)) 397 ); 398 399 400 SET default_with_oids = false; 401 402 -- 403 -- Name: venue_types; Type: TABLE; Schema: public; Owner: wifidog; Tablespace: 404 -- 405 406 CREATE TABLE venue_types ( 407 venue_type text NOT NULL 408 ); 409 410 411 -- 412 -- Name: venues; Type: TABLE; Schema: public; Owner: wifidog; Tablespace: 413 -- 414 415 CREATE TABLE venues ( 416 name text NOT NULL, 417 description text 418 ); 419 420 421 -- 422 -- Name: administrators_pkey; Type: CONSTRAINT; Schema: public; Owner: wifidog; Tablespace: 403 423 -- 404 424 … … 408 428 409 429 -- 410 -- TOC entry 30 (OID 728601) 411 -- Name: token_status_pkey; Type: CONSTRAINT; Schema: public; Owner: wifidog 430 -- Name: connections_pkey; Type: CONSTRAINT; Schema: public; Owner: wifidog; Tablespace: 431 -- 432 433 ALTER TABLE ONLY connections 434 ADD CONSTRAINT connections_pkey PRIMARY KEY (conn_id); 435 436 437 -- 438 -- Name: content_group_element_has_allowed_nodes_pkey; Type: CONSTRAINT; Schema: public; Owner: wifidog; Tablespace: 439 -- 440 441 ALTER TABLE ONLY content_group_element_has_allowed_nodes 442 ADD CONSTRAINT content_group_element_has_allowed_nodes_pkey PRIMARY KEY (content_group_element_id, node_id); 443 444 445 -- 446 -- Name: content_group_element_pkey; Type: CONSTRAINT; Schema: public; Owner: wifidog; Tablespace: 447 -- 448 449 ALTER TABLE ONLY content_group_element 450 ADD CONSTRAINT content_group_element_pkey PRIMARY KEY (content_group_element_id); 451 452 453 -- 454 -- Name: content_group_element_portal_display_log_pkey; Type: CONSTRAINT; Schema: public; Owner: wifidog; Tablespace: 455 -- 456 457 ALTER TABLE ONLY content_display_log 458 ADD CONSTRAINT content_group_element_portal_display_log_pkey PRIMARY KEY (user_id, content_id, node_id); 459 460 461 -- 462 -- Name: content_group_pkey; Type: CONSTRAINT; Schema: public; Owner: wifidog; Tablespace: 463 -- 464 465 ALTER TABLE ONLY content_group 466 ADD CONSTRAINT content_group_pkey PRIMARY KEY (content_group_id); 467 468 469 -- 470 -- Name: content_has_owners_pkey; Type: CONSTRAINT; Schema: public; Owner: wifidog; Tablespace: 471 -- 472 473 ALTER TABLE ONLY content_has_owners 474 ADD CONSTRAINT content_has_owners_pkey PRIMARY KEY (content_id, user_id); 475 476 477 -- 478 -- Name: content_pkey; Type: CONSTRAINT; Schema: public; Owner: wifidog; Tablespace: 479 -- 480 481 ALTER TABLE ONLY content 482 ADD CONSTRAINT content_pkey PRIMARY KEY (content_id); 483 484 485 -- 486 -- Name: content_rss_aggregator_feeds_pkey; Type: CONSTRAINT; Schema: public; Owner: wifidog; Tablespace: 487 -- 488 489 ALTER TABLE ONLY content_rss_aggregator_feeds 490 ADD CONSTRAINT content_rss_aggregator_feeds_pkey PRIMARY KEY (content_id, url); 491 492 493 -- 494 -- Name: content_rss_aggregator_pkey; Type: CONSTRAINT; Schema: public; Owner: wifidog; Tablespace: 495 -- 496 497 ALTER TABLE ONLY content_rss_aggregator 498 ADD CONSTRAINT content_rss_aggregator_pkey PRIMARY KEY (content_id); 499 500 501 -- 502 -- Name: files_pkey; Type: CONSTRAINT; Schema: public; Owner: wifidog; Tablespace: 503 -- 504 505 ALTER TABLE ONLY files 506 ADD CONSTRAINT files_pkey PRIMARY KEY (files_id); 507 508 509 -- 510 -- Name: flickr_photostream_pkey; Type: CONSTRAINT; Schema: public; Owner: wifidog; Tablespace: 511 -- 512 513 ALTER TABLE ONLY flickr_photostream 514 ADD CONSTRAINT flickr_photostream_pkey PRIMARY KEY (flickr_photostream_id); 515 516 517 -- 518 -- Name: iframes_pkey; Type: CONSTRAINT; Schema: public; Owner: wifidog; Tablespace: 519 -- 520 521 ALTER TABLE ONLY iframes 522 ADD CONSTRAINT iframes_pkey PRIMARY KEY (iframes_id); 523 524 525 -- 526 -- Name: langstring_entries_pkey; Type: CONSTRAINT; Schema: public; Owner: wifidog; Tablespace: 527 -- 528 529 ALTER TABLE ONLY langstring_entries 530 ADD CONSTRAINT langstring_entries_pkey PRIMARY KEY (langstring_entries_id); 531 532 533 -- 534 -- Name: locales_pkey; Type: CONSTRAINT; Schema: public; Owner: wifidog; Tablespace: 535 -- 536 537 ALTER TABLE ONLY locales 538 ADD CONSTRAINT locales_pkey PRIMARY KEY (locales_id); 539 540 541 -- 542 -- Name: network_has_content_pkey; Type: CONSTRAINT; Schema: public; Owner: wifidog; Tablespace: 543 -- 544 545 ALTER TABLE ONLY network_has_content 546 ADD CONSTRAINT network_has_content_pkey PRIMARY KEY (network_id, content_id); 547 548 549 -- 550 -- Name: node_deployment_status_pkey; Type: CONSTRAINT; Schema: public; Owner: wifidog; Tablespace: 551 -- 552 553 ALTER TABLE ONLY node_deployment_status 554 ADD CONSTRAINT node_deployment_status_pkey PRIMARY KEY (node_deployment_status); 555 556 557 -- 558 -- Name: node_has_content_pkey; Type: CONSTRAINT; Schema: public; Owner: wifidog; Tablespace: 559 -- 560 561 ALTER TABLE ONLY node_has_content 562 ADD CONSTRAINT node_has_content_pkey PRIMARY KEY (node_id, content_id); 563 564 565 -- 566 -- Name: node_owners_pkey; Type: CONSTRAINT; Schema: public; Owner: wifidog; Tablespace: 567 -- 568 569 ALTER TABLE ONLY node_owners 570 ADD CONSTRAINT node_owners_pkey PRIMARY KEY (node_id, user_id); 571 572 573 -- 574 -- Name: nodes_pkey; Type: CONSTRAINT; Schema: public; Owner: wifidog; Tablespace: 575 -- 576 577 ALTER TABLE ONLY nodes 578 ADD CONSTRAINT nodes_pkey PRIMARY KEY (node_id); 579 580 581 -- 582 -- Name: pictures_pkey; Type: CONSTRAINT; Schema: public; Owner: wifidog; Tablespace: 583 -- 584 585 ALTER TABLE ONLY pictures 586 ADD CONSTRAINT pictures_pkey PRIMARY KEY (pictures_id); 587 588 589 -- 590 -- Name: schema_info_pkey; Type: CONSTRAINT; Schema: public; Owner: wifidog; Tablespace: 591 -- 592 593 ALTER TABLE ONLY schema_info 594 ADD CONSTRAINT schema_info_pkey PRIMARY KEY (tag); 595 596 597 -- 598 -- Name: token_status_pkey; Type: CONSTRAINT; Schema: public; Owner: wifidog; Tablespace: 412 599 -- 413 600 … … 417 604 418 605 -- 419 -- TOC entry 31 (OID 728603) 420 -- Name: connections_pkey; Type: CONSTRAINT; Schema: public; Owner: wifidog 421 -- 422 423 ALTER TABLE ONLY connections 424 ADD CONSTRAINT connections_pkey PRIMARY KEY (conn_id); 425 426 427 -- 428 -- TOC entry 34 (OID 728605) 429 -- Name: nodes_pkey; Type: CONSTRAINT; Schema: public; Owner: wifidog 430 -- 431 432 ALTER TABLE ONLY nodes 433 ADD CONSTRAINT nodes_pkey PRIMARY KEY (node_id); 434 435 436 -- 437 -- TOC entry 36 (OID 728607) 438 -- Name: users_pkey; Type: CONSTRAINT; Schema: public; Owner: wifidog 606 -- Name: user_has_content_pkey; Type: CONSTRAINT; Schema: public; Owner: wifidog; Tablespace: 607 -- 608 609 ALTER TABLE ONLY user_has_content 610 ADD CONSTRAINT user_has_content_pkey PRIMARY KEY (user_id, content_id); 611 612 613 -- 614 -- Name: users_pkey; Type: CONSTRAINT; Schema: public; Owner: wifidog; Tablespace: 439 615 -- 440 616 … … 444 620 445 621 -- 446 -- TOC entry 37 (OID 728609) 447 -- Name: node_owners_pkey; Type: CONSTRAINT; Schema: public; Owner: wifidog 448 -- 449 450 ALTER TABLE ONLY node_owners 451 ADD CONSTRAINT node_owners_pkey PRIMARY KEY (node_id, user_id); 452 453 454 -- 455 -- TOC entry 38 (OID 728611) 456 -- Name: node_deployment_status_pkey; Type: CONSTRAINT; Schema: public; Owner: wifidog 457 -- 458 459 ALTER TABLE ONLY node_deployment_status 460 ADD CONSTRAINT node_deployment_status_pkey PRIMARY KEY (node_deployment_status); 461 462 463 -- 464 -- TOC entry 39 (OID 728613) 465 -- Name: venue_types_pkey; Type: CONSTRAINT; Schema: public; Owner: wifidog 622 -- Name: venue_types_pkey; Type: CONSTRAINT; Schema: public; Owner: wifidog; Tablespace: 466 623 -- 467 624 … … 471 628 472 629 -- 473 -- TOC entry 40 (OID 728615) 474 -- Name: schema_info_pkey; Type: CONSTRAINT; Schema: public; Owner: wifidog 475 -- 476 477 ALTER TABLE ONLY schema_info 478 ADD CONSTRAINT schema_info_pkey PRIMARY KEY (tag); 479 480 481 -- 482 -- TOC entry 41 (OID 728654) 483 -- Name: locales_pkey; Type: CONSTRAINT; Schema: public; Owner: wifidog 484 -- 485 486 ALTER TABLE ONLY locales 487 ADD CONSTRAINT locales_pkey PRIMARY KEY (locales_id); 488 489 490 -- 491 -- TOC entry 42 (OID 728670) 492 -- Name: content_pkey; Type: CONSTRAINT; Schema: public; Owner: wifidog 493 -- 494 495 ALTER TABLE ONLY content 496 ADD CONSTRAINT content_pkey PRIMARY KEY (content_id); 497 498 499 -- 500 -- TOC entry 43 (OID 728694) 501 -- Name: content_has_owners_pkey; Type: CONSTRAINT; Schema: public; Owner: wifidog 502 -- 503 504 ALTER TABLE ONLY content_has_owners 505 ADD CONSTRAINT content_has_owners_pkey PRIMARY KEY (content_id, user_id); 506 507 508 -- 509 -- TOC entry 44 (OID 728710) 510 -- Name: langstring_entries_pkey; Type: CONSTRAINT; Schema: public; Owner: wifidog 511 -- 512 513 ALTER TABLE ONLY langstring_entries 514 ADD CONSTRAINT langstring_entries_pkey PRIMARY KEY (langstring_entries_id); 515 516 517 -- 518 -- TOC entry 45 (OID 728727) 519 -- Name: content_group_pkey; Type: CONSTRAINT; Schema: public; Owner: wifidog 520 -- 521 522 ALTER TABLE ONLY content_group 523 ADD CONSTRAINT content_group_pkey PRIMARY KEY (content_group_id); 524 525 526 -- 527 -- TOC entry 46 (OID 728739) 528 -- Name: content_group_element_pkey; Type: CONSTRAINT; Schema: public; Owner: wifidog 529 -- 530 531 ALTER TABLE ONLY content_group_element 532 ADD CONSTRAINT content_group_element_pkey PRIMARY KEY (content_group_element_id); 533 534 535 -- 536 -- TOC entry 48 (OID 728760) 537 -- Name: content_group_element_has_allowed_nodes_pkey; Type: CONSTRAINT; Schema: public; Owner: wifidog 538 -- 539 540 ALTER TABLE ONLY content_group_element_has_allowed_nodes 541 ADD CONSTRAINT content_group_element_has_allowed_nodes_pkey PRIMARY KEY (content_group_element_id, node_id); 542 543 544 -- 545 -- TOC entry 49 (OID 728796) 546 -- Name: user_has_content_pkey; Type: CONSTRAINT; Schema: public; Owner: wifidog 547 -- 548 549 ALTER TABLE ONLY user_has_content 550 ADD CONSTRAINT user_has_content_pkey PRIMARY KEY (user_id, content_id); 551 552 553 -- 554 -- TOC entry 50 (OID 728812) 555 -- Name: node_has_content_pkey; Type: CONSTRAINT; Schema: public; Owner: wifidog 556 -- 557 558 ALTER TABLE ONLY node_has_content 559 ADD CONSTRAINT node_has_content_pkey PRIMARY KEY (node_id, content_id); 560 561 562 -- 563 -- TOC entry 51 (OID 728828) 564 -- Name: network_has_content_pkey; Type: CONSTRAINT; Schema: public; Owner: wifidog 565 -- 566 567 ALTER TABLE ONLY network_has_content 568 ADD CONSTRAINT network_has_content_pkey PRIMARY KEY (network_id, content_id); 569 570 571 -- 572 -- TOC entry 52 (OID 741754) 573 -- Name: flickr_photostream_pkey; Type: CONSTRAINT; Schema: public; Owner: wifidog 574 -- 575 576 ALTER TABLE ONLY flickr_photostream 577 ADD CONSTRAINT flickr_photostream_pkey PRIMARY KEY (flickr_photostream_id); 578 579 580 -- 581 -- TOC entry 53 (OID 741765) 582 -- Name: files_pkey; Type: CONSTRAINT; Schema: public; Owner: wifidog 583 -- 584 585 ALTER TABLE ONLY files 586 ADD CONSTRAINT files_pkey PRIMARY KEY (files_id); 587 588 589 -- 590 -- TOC entry 54 (OID 741779) 591 -- Name: content_group_element_portal_display_log_pkey; Type: CONSTRAINT; Schema: public; Owner: wifidog 592 -- 593 594 ALTER TABLE ONLY content_display_log 595 ADD CONSTRAINT content_group_element_portal_display_log_pkey PRIMARY KEY (user_id, content_id, node_id); 596 597 598 -- 599 -- TOC entry 56 (OID 728617) 630 -- Name: idx_content_group_element_content_group_id; Type: INDEX; Schema: public; Owner: wifidog; Tablespace: 631 -- 632 633 CREATE INDEX idx_content_group_element_content_group_id ON content_group_element USING btree (content_group_id); 634 635 636 -- 637 -- Name: idx_token; Type: INDEX; Schema: public; Owner: wifidog; Tablespace: 638 -- 639 640 CREATE INDEX idx_token ON connections USING btree (token); 641 642 643 -- 644 -- Name: idx_token_status_and_user_id; Type: INDEX; Schema: public; Owner: wifidog; Tablespace: 645 -- 646 647 CREATE INDEX idx_token_status_and_user_id ON connections USING btree (token_status, user_id); 648 649 650 -- 651 -- Name: idx_unique_username_and_account_origin; Type: INDEX; Schema: public; Owner: wifidog; Tablespace: 652 -- 653 654 CREATE UNIQUE INDEX idx_unique_username_and_account_origin ON users USING btree (username, account_origin); 655 656 657 -- 600 658 -- Name: $1; Type: FK CONSTRAINT; Schema: public; Owner: wifidog 601 659 -- … … 606 664 607 665 -- 608 -- TOC entry 55 (OID 728621) 666 -- Name: $1; Type: FK CONSTRAINT; Schema: public; Owner: wifidog 667 -- 668 669 ALTER TABLE ONLY users 670 ADD CONSTRAINT "$1" FOREIGN KEY (prefered_locale) REFERENCES locales(locales_id) ON UPDATE CASCADE ON DELETE SET NULL; 671 672 673 -- 674 -- Name: $1; Type: FK CONSTRAINT; Schema: public; Owner: wifidog 675 -- 676 677 ALTER TABLE ONLY content 678 ADD CONSTRAINT "$1" FOREIGN KEY (title) REFERENCES content(content_id) ON UPDATE CASCADE ON DELETE RESTRICT; 679 680 681 -- 682 -- Name: $1; Type: FK CONSTRAINT; Schema: public; Owner: wifidog 683 -- 684 685 ALTER TABLE ONLY content_has_owners 686 ADD CONSTRAINT "$1" FOREIGN KEY (content_id) REFERENCES content(content_id) ON UPDATE CASCADE ON DELETE CASCADE; 687 688 689 -- 690 -- Name: $1; Type: FK CONSTRAINT; Schema: public; Owner: wifidog 691 -- 692 693 ALTER TABLE ONLY langstring_entries 694 ADD CONSTRAINT "$1" FOREIGN KEY (langstrings_id) REFERENCES content(content_id) ON UPDATE CASCADE ON DELETE CASCADE; 695 696 697 -- 698 -- Name: $1; Type: FK CONSTRAINT; Schema: public; Owner: wifidog 699 -- 700 701 ALTER TABLE ONLY content_group 702 ADD CONSTRAINT "$1" FOREIGN KEY (content_group_id) REFERENCES content(content_id) ON UPDATE CASCADE ON DELETE CASCADE; 703 704 705 -- 706 -- Name: $1; Type: FK CONSTRAINT; Schema: public; Owner: wifidog 707 -- 708 709 ALTER TABLE ONLY content_group_element 710 ADD CONSTRAINT "$1" FOREIGN KEY (content_group_element_id) REFERENCES content(content_id) ON UPDATE CASCADE ON DELETE CASCADE; 711 712 713 -- 714 -- Name: $1; Type: FK CONSTRAINT; Schema: public; Owner: wifidog 715 -- 716 717 ALTER TABLE ONLY content_group_element_has_allowed_nodes 718 ADD CONSTRAINT "$1" FOREIGN KEY (content_group_element_id) REFERENCES content_group_element(content_group_element_id) ON UPDATE CASCADE ON DELETE CASCADE; 719 720 721 -- 722 -- Name: $1; Type: FK CONSTRAINT; Schema: public; Owner: wifidog 723 -- 724 725 ALTER TABLE ONLY user_has_content 726 ADD CONSTRAINT "$1" FOREIGN KEY (user_id) REFERENCES users(user_id) ON UPDATE CASCADE ON DELETE CASCADE; 727 728 729 -- 730 -- Name: $1; Type: FK CONSTRAINT; Schema: public; Owner: wifidog 731 -- 732 733 ALTER TABLE ONLY node_has_content 734 ADD CONSTRAINT "$1" FOREIGN KEY (node_id) REFERENCES nodes(node_id) ON UPDATE CASCADE ON DELETE CASCADE; 735 736 737 -- 738 -- Name: $1; Type: FK CONSTRAINT; Schema: public; Owner: wifidog 739 -- 740 741 ALTER TABLE ONLY network_has_content 742 ADD CONSTRAINT "$1" FOREIGN KEY (content_id) REFERENCES content(content_id) ON UPDATE CASCADE ON DELETE CASCADE; 743 744 745 -- 746 -- Name: $1; Type: FK CONSTRAINT; Schema: public; Owner: wifidog 747 -- 748 749 ALTER TABLE ONLY content_display_log 750 ADD CONSTRAINT "$1" FOREIGN KEY (user_id) REFERENCES users(user_id) ON UPDATE CASCADE ON DELETE CASCADE; 751 752 753 -- 754 -- Name: $1; Type: FK CONSTRAINT; Schema: public; Owner: wifidog 755 -- 756 757 ALTER TABLE ONLY pictures 758 ADD CONSTRAINT "$1" FOREIGN KEY (pictures_id) REFERENCES files(files_id) ON UPDATE CASCADE ON DELETE CASCADE; 759 760 761 -- 762 -- Name: $2; Type: FK CONSTRAINT; Schema: public; Owner: wifidog 763 -- 764 765 ALTER TABLE ONLY content 766 ADD CONSTRAINT "$2" FOREIGN KEY (description) REFERENCES content(content_id) ON UPDATE CASCADE ON DELETE RESTRICT; 767 768 769 -- 770 -- Name: $2; Type: FK CONSTRAINT; Schema: public; Owner: wifidog 771 -- 772 773 ALTER TABLE ONLY content_has_owners 774 ADD CONSTRAINT "$2" FOREIGN KEY (user_id) REFERENCES users(user_id) ON UPDATE CASCADE ON DELETE CASCADE; 775 776 777 -- 778 -- Name: $2; Type: FK CONSTRAINT; Schema: public; Owner: wifidog 779 -- 780 781 ALTER TABLE ONLY langstring_entries 782 ADD CONSTRAINT "$2" FOREIGN KEY (locales_id) REFERENCES locales(locales_id) ON UPDATE CASCADE ON DELETE RESTRICT; 783 784 785 -- 786 -- Name: $2; Type: FK CONSTRAINT; Schema: public; Owner: wifidog 787 -- 788 789 ALTER TABLE ONLY content_group_element 790 ADD CONSTRAINT "$2" FOREIGN KEY (content_group_id) REFERENCES content_group(content_group_id) ON UPDATE CASCADE ON DELETE CASCADE; 791 792 793 -- 794 -- Name: $2; Type: FK CONSTRAINT; Schema: public; Owner: wifidog 795 -- 796 797 ALTER TABLE ONLY content_group_element_has_allowed_nodes 798 ADD CONSTRAINT "$2" FOREIGN KEY (node_id) REFERENCES nodes(node_id) ON UPDATE CASCADE ON DELETE CASCADE; 799 800 801 -- 802 -- Name: $2; Type: FK CONSTRAINT; Schema: public; Owner: wifidog 803 -- 804 805 ALTER TABLE ONLY user_has_content 806 ADD CONSTRAINT "$2" FOREIGN KEY (content_id) REFERENCES content(content_id) ON UPDATE CASCADE ON DELETE CASCADE; 807 808 809 -- 810 -- Name: $2; Type: FK CONSTRAINT; Schema: public; Owner: wifidog 811 -- 812 813 ALTER TABLE ONLY node_has_content 814 ADD CONSTRAINT "$2" FOREIGN KEY (content_id) REFERENCES content(content_id) ON UPDATE CASCADE ON DELETE CASCADE; 815 816 817 -- 818 -- Name: $2; Type: FK CONSTRAINT; Schema: public; Owner: wifidog 819 -- 820 821 ALTER TABLE ONLY content_display_log 822 ADD CONSTRAINT "$2" FOREIGN KEY (content_id) REFERENCES content(content_id) ON UPDATE CASCADE ON DELETE CASCADE; 823 824 825 -- 826 -- Name: $3; Type: FK CONSTRAINT; Schema: public; Owner: wifidog 827 -- 828 829 ALTER TABLE ONLY content 830 ADD CONSTRAINT "$3" FOREIGN KEY (project_info) REFERENCES content(content_id) ON UPDATE CASCADE ON DELETE RESTRICT; 831 832 833 -- 834 -- Name: $3; Type: FK CONSTRAINT; Schema: public; Owner: wifidog 835 -- 836 837 ALTER TABLE ONLY content_group_element 838 ADD CONSTRAINT "$3" FOREIGN KEY (displayed_content_id) REFERENCES content(content_id) ON UPDATE CASCADE ON DELETE CASCADE; 839 840 841 -- 842 -- Name: $3; Type: FK CONSTRAINT; Schema: public; Owner: wifidog 843 -- 844 845 ALTER TABLE ONLY content_display_log 846 ADD CONSTRAINT "$3" FOREIGN KEY (node_id) REFERENCES nodes(node_id) ON UPDATE CASCADE ON DELETE CASCADE; 847 848 849 -- 850 -- Name: $4; Type: FK CONSTRAINT; Schema: public; Owner: wifidog 851 -- 852 853 ALTER TABLE ONLY content 854 ADD CONSTRAINT "$4" FOREIGN KEY (sponsor_info) REFERENCES content(content_id) ON UPDATE CASCADE ON DELETE RESTRICT; 855 856 857 -- 858 -- Name: $5; Type: FK CONSTRAINT; Schema: public; Owner: wifidog 859 -- 860 861 ALTER TABLE ONLY content 862 ADD CONSTRAINT "$5" FOREIGN KEY (long_description) REFERENCES content(content_id) ON UPDATE CASCADE ON DELETE RESTRICT; 863 864 865 -- 609 866 -- Name: administrators_ibfk_1; Type: FK CONSTRAINT; Schema: public; Owner: wifidog 610 867 -- … … 615 872 616 873 -- 617 -- TOC entry 57 (OID 728625) 874 -- Name: content_rss_aggregator_content_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: wifidog 875 -- 876 877 ALTER TABLE ONLY content_rss_aggregator 878 ADD CONSTRAINT content_rss_aggregator_content_id_fkey FOREIGN KEY (content_id) REFERENCES content(content_id) ON UPDATE CASCADE ON DELETE CASCADE; 879 880 881 -- 882 -- Name: content_rss_aggregator_feeds_content_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: wifidog 883 -- 884 885 ALTER TABLE ONLY content_rss_aggregator_feeds 886 ADD CONSTRAINT content_rss_aggregator_feeds_content_id_fkey FOREIGN KEY (content_id) REFERENCES content_rss_aggregator(content_id) ON UPDATE CASCADE ON DELETE CASCADE; 887 888 889 -- 890 -- Name: fk_node_deployment_status; Type: FK CONSTRAINT; Schema: public; Owner: wifidog 891 -- 892 893 ALTER TABLE ONLY nodes 894 ADD CONSTRAINT fk_node_deployment_status FOREIGN KEY (node_deployment_status) REFERENCES node_deployment_status(node_deployment_status) ON UPDATE CASCADE ON DELETE RESTRICT; 895 896 897 -- 898 -- Name: fk_nodes; Type: FK CONSTRAINT; Schema: public; Owner: wifidog 899 -- 900 901 ALTER TABLE ONLY connections 902 ADD CONSTRAINT fk_nodes FOREIGN KEY (node_id) REFERENCES nodes(node_id) ON UPDATE CASCADE ON DELETE RESTRICT; 903 904 905 -- 906 -- Name: fk_nodes; Type: FK CONSTRAINT; Schema: public; Owner: wifidog 907 -- 908 909 ALTER TABLE ONLY node_owners 910 ADD CONSTRAINT fk_nodes FOREIGN KEY (node_id) REFERENCES nodes(node_id) ON UPDATE CASCADE ON DELETE CASCADE; 911 912 913 -- 618 914 -- Name: fk_users; Type: FK CONSTRAINT; Schema: public; Owner: wifidog 619 915 -- … … 624 920 625 921 -- 626 -- TOC entry 58 (OID 728629)627 -- Name: fk_nodes; Type: FK CONSTRAINT; Schema: public; Owner: wifidog628 --629 630 ALTER TABLE ONLY connections631 ADD CONSTRAINT fk_nodes FOREIGN KEY (node_id) REFERENCES nodes(node_id) ON UPDATE CASCADE ON DELETE RESTRICT;632 633 634 --635 -- TOC entry 62 (OID 728633)636 922 -- Name: fk_users; Type: FK CONSTRAINT; Schema: public; Owner: wifidog 637 923 -- … … 642 928 643 929 -- 644 -- TOC entry 63 (OID 728637)645 -- Name: fk_nodes; Type: FK CONSTRAINT; Schema: public; Owner: wifidog646 --647 648 ALTER TABLE ONLY node_owners649 ADD CONSTRAINT fk_nodes FOREIGN KEY (node_id) REFERENCES nodes(node_id) ON UPDATE CASCADE ON DELETE CASCADE;650 651 652 --653 -- TOC entry 59 (OID 728641)654 -- Name: fk_node_deployment_status; Type: FK CONSTRAINT; Schema: public; Owner: wifidog655 --656 657 ALTER TABLE ONLY nodes658 ADD CONSTRAINT fk_node_deployment_status FOREIGN KEY (node_deployment_status) REFERENCES node_deployment_status(node_deployment_status) ON UPDATE CASCADE ON DELETE RESTRICT;659 660 661 --662 -- TOC entry 60 (OID 728645)663 930 -- Name: fk_venue_types; Type: FK CONSTRAINT; Schema: public; Owner: wifidog 664 931 -- … … 669 936 670 937 -- 671 -- TOC entry 61 (OID 728659)672 -- Name: $1; Type: FK CONSTRAINT; Schema: public; Owner: wifidog673 --674 675 ALTER TABLE ONLY users676 ADD CONSTRAINT "$1" FOREIGN KEY (prefered_locale) REFERENCES locales(locales_id) ON UPDATE CASCADE ON DELETE SET NULL;677 678 679 --680 -- TOC entry 64 (OID 728672)681 -- Name: $1; Type: FK CONSTRAINT; Schema: public; Owner: wifidog682 --683 684 ALTER TABLE ONLY content685 ADD CONSTRAINT "$1" FOREIGN KEY (title) REFERENCES content(content_id) ON UPDATE CASCADE ON DELETE RESTRICT;686 687 688 --689 -- TOC entry 65 (OID 728676)690 -- Name: $2; Type: FK CONSTRAINT; Schema: public; Owner: wifidog691 --692 693 ALTER TABLE ONLY content694 ADD CONSTRAINT "$2" FOREIGN KEY (description) REFERENCES content(content_id) ON UPDATE CASCADE ON DELETE RESTRICT;695 696 697 --698 -- TOC entry 66 (OID 728680)699 -- Name: $3; Type: FK CONSTRAINT; Schema: public; Owner: wifidog700 --701 702 ALTER TABLE ONLY content703 ADD CONSTRAINT "$3" FOREIGN KEY (project_info) REFERENCES content(content_id) ON UPDATE CASCADE ON DELETE RESTRICT;704 705 706 --707 -- TOC entry 67 (OID 728684)708 -- Name: $4; Type: FK CONSTRAINT; Schema: public; Owner: wifidog709 --710 711 ALTER TABLE ONLY content712 ADD CONSTRAINT "$4" FOREIGN KEY (sponsor_info) REFERENCES content(content_id) ON UPDATE CASCADE ON DELETE RESTRICT;713 714 715 --716 -- TOC entry 68 (OID 728696)717 -- Name: $1; Type: FK CONSTRAINT; Schema: public; Owner: wifidog718 --719 720 ALTER TABLE ONLY content_has_owners721 ADD CONSTRAINT "$1" FOREIGN KEY (content_id) REFERENCES content(content_id) ON UPDATE CASCADE ON DELETE CASCADE;722 723 724 --725 -- TOC entry 69 (OID 728700)726 -- Name: $2; Type: FK CONSTRAINT; Schema: public; Owner: wifidog727 --728 729 ALTER TABLE ONLY content_has_owners730 ADD CONSTRAINT "$2" FOREIGN KEY (user_id) REFERENCES users(user_id) ON UPDATE CASCADE ON DELETE CASCADE;731 732 733 --734 -- TOC entry 70 (OID 728712)735 -- Name: $1; Type: FK CONSTRAINT; Schema: public; Owner: wifidog736 --737 738 ALTER TABLE ONLY langstring_entries739 ADD CONSTRAINT "$1" FOREIGN KEY (langstrings_id) REFERENCES content(content_id) ON UPDATE CASCADE ON DELETE CASCADE;740 741 742 --743 -- TOC entry 71 (OID 728716)744 -- Name: $2; Type: FK CONSTRAINT; Schema: public; Owner: wifidog745 --746 747 ALTER TABLE ONLY langstring_entries748 ADD CONSTRAINT "$2" FOREIGN KEY (locales_id) REFERENCES locales(locales_id) ON UPDATE CASCADE ON DELETE RESTRICT;749 750 751 --752 -- TOC entry 72 (OID 728729)753 -- Name: $1; Type: FK CONSTRAINT; Schema: public; Owner: wifidog754 --755 756 ALTER TABLE ONLY content_group757 ADD CONSTRAINT "$1" FOREIGN KEY (content_group_id) REFERENCES content(content_id) ON UPDATE CASCADE ON DELETE CASCADE;758 759 760 --761 -- TOC entry 73 (OID 728741)762 -- Name: $1; Type: FK CONSTRAINT; Schema: public; Owner: wifidog763 --764 765 ALTER TABLE ONLY content_group_element766 ADD CONSTRAINT "$1" FOREIGN KEY (content_group_element_id) REFERENCES content(content_id) ON UPDATE CASCADE ON DELETE CASCADE;767 768 769 --770 -- TOC entry 74 (OID 728745)771 -- Name: $2; Type: FK CONSTRAINT; Schema: public; Owner: wifidog772 --773 774 ALTER TABLE ONLY content_group_element775 ADD CONSTRAINT "$2" FOREIGN KEY (content_group_id) REFERENCES content_group(content_group_id) ON UPDATE CASCADE ON DELETE CASCADE;776 777 778 --779 -- TOC entry 75 (OID 728749)780 -- Name: $3; Type: FK CONSTRAINT; Schema: public; Owner: wifidog781 --782 783 ALTER TABLE ONLY content_group_element784 ADD CONSTRAINT "$3" FOREIGN KEY (displayed_content_id) REFERENCES content(content_id) ON UPDATE CASCADE ON DELETE CASCADE;785 786 787 --788 -- TOC entry 76 (OID 728762)789 -- Name: $1; Type: FK CONSTRAINT; Schema: public; Owner: wifidog790 --791 792 ALTER TABLE ONLY content_group_element_has_allowed_nodes793 ADD CONSTRAINT "$1" FOREIGN KEY (content_group_element_id) REFERENCES content_group_element(content_group_element_id) ON UPDATE CASCADE ON DELETE CASCADE;794 795 796 --797 -- TOC entry 77 (OID 728766)798 -- Name: $2; Type: FK CONSTRAINT; Schema: public; Owner: wifidog799 --800 801 ALTER TABLE ONLY content_group_element_has_allowed_nodes802 ADD CONSTRAINT "$2" FOREIGN KEY (node_id) REFERENCES nodes(node_id) ON UPDATE CASCADE ON DELETE CASCADE;803 804 805 --806 -- TOC entry 78 (OID 728798)807 -- Name: $1; Type: FK CONSTRAINT; Schema: public; Owner: wifidog808 --809 810 ALTER TABLE ONLY user_has_content811 ADD CONSTRAINT "$1" FOREIGN KEY (user_id) REFERENCES users(user_id) ON UPDATE CASCADE ON DELETE CASCADE;812 813 814 --815 -- TOC entry 79 (OID 728802)816 -- Name: $2; Type: FK CONSTRAINT; Schema: public; Owner: wifidog817 --818 819 ALTER TABLE ONLY user_has_content820 ADD CONSTRAINT "$2" FOREIGN KEY (content_id) REFERENCES content(content_id) ON UPDATE CASCADE ON DELETE CASCADE;821 822 823 --824 -- TOC entry 80 (OID 728814)825 -- Name: $1; Type: FK CONSTRAINT; Schema: public; Owner: wifidog826 --827 828 ALTER TABLE ONLY node_has_content829 ADD CONSTRAINT "$1" FOREIGN KEY (node_id) REFERENCES nodes(node_id) ON UPDATE CASCADE ON DELETE CASCADE;830 831 832 --833 -- TOC entry 81 (OID 728818)834 -- Name: $2; Type: FK CONSTRAINT; Schema: public; Owner: wifidog835 --836 837 ALTER TABLE ONLY node_has_content838 ADD CONSTRAINT "$2" FOREIGN KEY (content_id) REFERENCES content(content_id) ON UPDATE CASCADE ON DELETE CASCADE;839 840 841 --842 -- TOC entry 82 (OID 728830)843 -- Name: $1; Type: FK CONSTRAINT; Schema: public; Owner: wifidog844 --845 846 ALTER TABLE ONLY network_has_content847 ADD CONSTRAINT "$1" FOREIGN KEY (content_id) REFERENCES content(content_id) ON UPDATE CASCADE ON DELETE CASCADE;848 849 850 --851 -- TOC entry 84 (OID 741781)852 -- Name: $1; Type: FK CONSTRAINT; Schema: public; Owner: wifidog853 --854 855 ALTER TABLE ONLY content_display_log856 ADD CONSTRAINT "$1" FOREIGN KEY (user_id) REFERENCES users(user_id) ON UPDATE CASCADE ON DELETE CASCADE;857 858 859 --860 -- TOC entry 85 (OID 741785)861 -- Name: $2; Type: FK CONSTRAINT; Schema: public; Owner: wifidog862 --863 864 ALTER TABLE ONLY content_display_log865 ADD CONSTRAINT "$2" FOREIGN KEY (content_id) REFERENCES content(content_id) ON UPDATE CASCADE ON DELETE CASCADE;866 867 868 --869 -- TOC entry 86 (OID 741789)870 -- Name: $3; Type: FK CONSTRAINT; Schema: public; Owner: wifidog871 --872 873 ALTER TABLE ONLY content_display_log874 ADD CONSTRAINT "$3" FOREIGN KEY (node_id) REFERENCES nodes(node_id) ON UPDATE CASCADE ON DELETE CASCADE;875 876 877 --878 -- TOC entry 83 (OID 741866)879 938 -- Name: flickr_photostream_content_fkey; Type: FK CONSTRAINT; Schema: public; Owner: wifidog 880 939 -- … … 885 944 886 945 -- 887 -- TOC entry 3 (OID 2200) 888 -- Name: SCHEMA public; Type: COMMENT; Schema: -; Owner: postgres 889 -- 890 891 COMMENT ON SCHEMA public IS 'Standard public schema'; 892 893 946 -- Name: iframes_iframes_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: wifidog 947 -- 948 949 ALTER TABLE ONLY iframes 950 ADD CONSTRAINT iframes_iframes_id_fkey FOREIGN KEY (iframes_id) REFERENCES content(content_id) ON UPDATE CASCADE ON DELETE CASCADE; 951 952 953 -- 954 -- PostgreSQL database dump complete 955 -- 956 -
trunk/wifidog-auth/wifidog/classes/MainUI.php
r684 r685 24 24 require_once BASEPATH.'include/common.php'; 25 25 require_once BASEPATH.'include/common_interface.php'; 26 26 27 /** Style contains functions managing headers, footers, stylesheet, etc. 27 28 */ … … 34 35 private $html_headers; 35 36 private $footer_scripts = array(); 37 38 /** @note We put a call to validate_schema() here so it systematically called 39 * from any UI page, but not from any machine readable pages 40 */ 36 41 function __construct() 37 42 { 43 require_once BASEPATH.'include/schema_validate.php'; 44 validate_schema(); 45 38 46 $this->smarty = new SmartyWifidog(); 39 47 $this->title = Network :: getCurrentNetwork()->getName().' '._("authentication server"); //Default title -
trunk/wifidog-auth/wifidog/classes/Node.php
r684 r685 1 1 <?php 2 2 3 /********************************************************************\ 3 4 * This program is free software; you can redistribute it and/or * … … 22 23 * @author Copyright (C) 2005 Benoit Gr�goire <bock@step.polymtl.ca> 23 24 */ 24 25 25 26 require_once BASEPATH.'include/common.php'; 26 27 require_once 'Content/ContentGroup.php'; … … 58 59 else 59 60 { 60 $object = self ::getCurrentRealNode();61 $object = self :: getCurrentRealNode(); 61 62 } 62 63 return $object; … … 109 110 $db->ExecSql($sql, $node_rows, false); 110 111 $node_row = $node_rows[0]; 111 if ($node_row!=null && $node_row['last_heartbeat_ip']==$_SERVER['REMOTE_ADDR'])112 if ($node_row != null && $node_row['last_heartbeat_ip'] == $_SERVER['REMOTE_ADDR']) 112 113 { 113 114 $retval = new self($node_row['node_id']); … … 115 116 } 116 117 } 117 return $retval;118 return $retval; 118 119 } 119 120 … … 126 127 $errmsg = _('Access denied!'); 127 128 } 128 129 129 130 global $db; 130 131 $id = $db->EscapeString($this->getId()); … … 137 138 $retval = true; 138 139 } 139 140 140 141 return $retval; 141 142 } … … 174 175 $node_id = $db->EscapeString($node_id); 175 176 $name = $db->EscapeString($name); 176 $rss_url = $db->EscapeString($rss_url);177 177 $home_page_url = $db->EscapeString($home_page_url); 178 178 $description = $db->EscapeString($description); … … 187 187 throw new Exception(_('This node already exists.')); 188 188 189 $sql = "INSERT INTO nodes (node_id, name, rss_url, creation_date, home_page_url, description, map_url, street_address, public_phone_number, public_email, mass_transit_info, node_deployment_status) VALUES ('$node_id','$name','$rss_url',NOW(),'$home_page_url','$description','$map_url','$street_address','$public_phone_number','$public_email','$mass_transit_info','$node_deployment_status')";189 $sql = "INSERT INTO nodes (node_id, name, creation_date, home_page_url, description, map_url, street_address, public_phone_number, public_email, mass_transit_info, node_deployment_status) VALUES ('$node_id','$name',NOW(),'$home_page_url','$description','$map_url','$street_address','$public_phone_number','$public_email','$mass_transit_info','$node_deployment_status')"; 190 190 191 191 if (!$db->ExecSqlUpdate($sql, false)) … … 234 234 return new self($_REQUEST[$name]); 235 235 } 236 236 237 237 /** Get an interface to select the deployment status 238 238 * @param $user_prefix A identifier provided by the programmer to recognise it's generated html form … … 244 244 $html = ''; 245 245 $name = "{$user_prefix}"; 246 $status_list = self ::getAllDeploymentStatus();246 $status_list = self :: getAllDeploymentStatus(); 247 247 if ($status_list != null) 248 248 { 249 $tab = array ();249 $tab = array (); 250 250 foreach ($status_list as $status) 251 $tab[] = array ($status, $status);251 $tab[] = array ($status, $status); 252 252 $html .= FormSelectGenerator :: generateFromArray($tab, $this->getDeploymentStatus(), $name, null, false); 253 253 } … … 279 279 } 280 280 $this->mRow = $row; 281 $this->mDb = & $db;281 $this->mDb = & $db; 282 282 $this->id = $row['node_id']; 283 283 } 284 284 285 285 function getID() 286 286 { 287 287 return $this->mRow['node_id']; 288 288 } 289 289 290 290 /** Return the name of the node 291 291 */ … … 294 294 return $this->mRow['name']; 295 295 } 296 296 297 297 function setName($name) 298 298 { … … 302 302 } 303 303 304 function getRssUrl()305 {306 return $this->mRow['rss_url'];307 }308 309 function setRssUrl($url)310 {311 $url = $this->mDb->EscapeString($url);312 $this->mDb->ExecSqlUpdate("UPDATE nodes SET rss_url = '{$url}' WHERE node_id = '{$this->getId()}'");313 $this->refresh();314 }315 316 304 function getHomePageURL() 317 305 { 318 306 return $this->mRow['home_page_url']; 319 307 } 320 308 321 309 function setHomePageUrl($url) 322 310 { … … 330 318 return $this->mRow['description']; 331 319 } 332 320 333 321 function setDescription($description) 334 322 { … … 342 330 return $this->mRow['map_url']; 343 331 } 344 332 345 333 function setMapURL($url) 346 334 { … … 354 342 return $this->mRow['street_address']; 355 343 } 356 344 357 345 function setAddress($address) 358 346 { … … 366 354 return $this->mRow['public_phone_number']; 367 355 } 368 356 369 357 function setTelephone($phone) 370 358 { … … 378 366 return $this->mRow['mass_transit_info']; 379 367 } 380 368 381 369 function setTransitInfo($transit_info) 382 370 { … … 390 378 return $this->mRow['public_email']; 391 379 } 392 380 393 381 function setEmail($email) 394 382 { … … 402 390 return $this->mRow['node_deployment_status']; 403 391 } 404 392 405 393 function setDeploymentStatus($status) 406 394 { … … 415 403 { 416 404 //TODO: Most of this code will be moved to Hotspot class when the abtraction will be completed 417 405 418 406 $html = ''; 419 407 $html .= "<div class='admin_container'>\n"; 420 408 $html .= "<div class='admin_class'>Node (".get_class($this)." instance)</div>\n"; 421 409 $html .= "<h3>"._("Edit a hotspot")."</h3>\n"; 422 410 423 411 // Information about the node 424 412 $html .= "<div class='admin_section_container'>\n"; 425 413 $html .= "<div class='admin_section_title'>"._("Information about the node:")."</div>\n"; 426 414 427 415 // Node ID 428 416 $html .= "<div class='admin_section_container'>\n"; … … 444 432 $html .= "</div>\n"; 445 433 $html .= "</div>\n"; 446 447 // RSS URL 448 $html .= "<div class='admin_section_container'>\n"; 449 $html .= "<div class='admin_section_title'>"._("RSS URL")." : </div>\n"; 450 $html .= "<div class='admin_section_data'>\n"; 451 $name = "node_".$this->getId()."_rss_url"; 452 $value = htmlspecialchars($this->getRSSUrl(), ENT_QUOTES); 453 $html .= "<input type='text' size ='50' value='$value' name='$name'>\n"; 454 $html .= "</div>\n"; 455 $html .= "</div>\n"; 456 434 457 435 // Homepage URL 458 436 $html .= "<div class='admin_section_container'>\n"; … … 464 442 $html .= "</div>\n"; 465 443 $html .= "</div>\n"; 466 444 467 445 // Description 468 446 $html .= "<div class='admin_section_container'>\n"; … … 474 452 $html .= "</div>\n"; 475 453 $html .= "</div>\n"; 476 454 477 455 // Map URL 478 456 $html .= "<div class='admin_section_container'>\n"; … … 484 462 $html .= "</div>\n"; 485 463 $html .= "</div>\n"; 486 464 487 465 // Street address 488 466 $html .= "<div class='admin_section_container'>\n"; … … 494 472 $html .= "</div>\n"; 495 473 $html .= "</div>\n"; 496 474 497 475 // Public phone # 498 476 $html .= "<div class='admin_section_container'>\n"; … … 504 482 $html .= "</div>\n"; 505 483 $html .= "</div>\n"; 506 484 507 485 // Public mail 508 486 $html .= "<div class='admin_section_container'>\n"; … … 514 492 $html .= "</div>\n"; 515 493 $html .= "</div>\n"; 516 494 517 495 // Mass transit info 518 496 $html .= "<div class='admin_section_container'>\n"; … … 524 502 $html .= "</div>\n"; 525 503 $html .= "</div>\n"; 526 504 527 505 // Deployment status 528 506 $html .= "<div class='admin_section_container'>\n"; 529 507 $html .= "<div class='admin_section_title'>"._("Node deployment status")." : </div>\n"; 530 508 $html .= "<div class='admin_section_data'>\n"; 531 $name = "node_".$this->getId()."_deployment_status"; 532 $html .= self ::getSelectDeploymentStatus($name);533 $html .= "</div>\n"; 534 $html .= "</div>\n"; 535 509 $name = "node_".$this->getId()."_deployment_status"; 510 $html .= self :: getSelectDeploymentStatus($name); 511 $html .= "</div>\n"; 512 $html .= "</div>\n"; 513 536 514 // End of information section 537 515 $html .= "</div>\n"; 538 516 539 517 // Owners management 540 518 $html .= "<div class='admin_section_container'>\n"; … … 562 540 $html .= "</div>\n"; 563 541 $html .= "</div>\n"; 564 542 565 543 // Display stats 566 544 $html .= "<div class='admin_section_container'>\n"; … … 571 549 $html .= "</div>\n"; 572 550 $html .= "</div>\n"; 573 551 574 552 $html .= "<div class='admin_section_container'>\n"; 575 553 $html .= "<div class='admin_section_title'>"._("Node content:")."</div>\n"; … … 604 582 public function processAdminUI() 605 583 { 606 $user = User ::getCurrentUser();584 $user = User :: getCurrentUser(); 607 585 if (!$this->isOwner($user) && !$user->isSuperAdmin()) 608 586 { 609 587 throw new Exception(_('Access denied!')); 610 588 } 611 589 612 590 // Information about the node 613 591 614 592 // Name 615 593 $name = "node_".$this->getId()."_name"; 616 594 $this->setName($_REQUEST[$name]); 617 618 // RSS URL 619 $name = "node_".$this->getId()."_rss_url"; 620 $this->setRssUrl($_REQUEST[$name]); 621 595 622 596 // Homepage URL 623 597 $name = "node_".$this->getId()."_homepage_url"; 624 598 $this->setHomePageUrl($_REQUEST[$name]); 625 599 626 600 // Description 627 601 $name = "node_".$this->getId()."_description"; 628 602 $this->setDescription($_REQUEST[$name]); 629 603 630 604 // Map URL 631 605 $name = "node_".$this->getId()."_map_url"; 632 606 $this->setMapUrl($_REQUEST[$name]); 633 607 634 608 // Street address 635 609 $name = "node_".$this->getId()."_street_address"; 636 610 $this->setAddress($_REQUEST[$name]); 637 611 638 612 // Public phone # 639 613 $name = "node_".$this->getId()."_public_phone"; 640 614 $this->setTelephone($_REQUEST[$name]); 641 615 642 616 // Public mail 643 617 $name = "node_".$this->getId()."_public_email"; 644 618 $this->setEmail($_REQUEST[$name]); 645 619 646 620 // Mass transit info 647 621 $name = "node_".$this->getId()."_mass_transit_info"; 648 622 $this->setTransitInfo($_REQUEST[$name]); 649 623 650 624 // Deployment status 651 625 $name = "node_".$this->getId()."_deployment_status"; 652 $this->setDeploymentStatus(self ::processSelectDeploymentStatus($name));626 $this->setDeploymentStatus(self :: processSelectDeploymentStatus($name)); 653 627 654 628 // Statistics … … 656 630 if (!empty ($_REQUEST[$name])) 657 631 header("Location: hotspot_log.php?node_id=".urlencode($this->getId())); 658 632 659 633 // Owners processing 660 634 // Rebuild user id, and delete if it was selected … … 664 638 if (!empty ($_REQUEST[$name])) 665 639 { 666 if ($this->isOwner($owner))640 if ($this->isOwner($owner)) 667 641 $this->removeOwner($owner); 668 642 else … … 676 650 $name = "node_{$this->getId()}_new_owner"; 677 651 $owner = User :: processSelectUserUI($name); 678 if($owner)679 {680 if($this->isOwner($owner))681 echo _("The user is already an owner of this node.");682 else683 $this->addOwner($owner);684 }685 } 686 652 if ($owner) 653 { 654 if ($this->isOwner($owner)) 655 echo _("The user is already an owner of this node."); 656 else 657 $this->addOwner($owner); 658 } 659 } 660 687 661 // Content processing 688 662 // Rebuild content id and deleting if it was selected for deletion ) … … 701 675 $name = "node_{$this->id}_new_content"; 702 676 $content = Content :: processSelectContentUI($name); 703 if($content)704 $this->addContent($content);705 } 706 } 707 708 // Redirect to this node's portal page709 public function getUserUI()710 {711 header("Location: ".BASE_SSL_PATH."portal/?gw_id=".$this->getId());712 }677 if ($content) 678 $this->addContent($content); 679 } 680 } 681 682 // Redirect to this node's portal page 683 public function getUserUI() 684 { 685 header("Location: ".BASE_SSL_PATH."portal/?gw_id=".$this->getId()); 686 } 713 687 714 688 /** Add content to this node */ … … 731 705 732 706 /**Get an array of all Content linked to this node 733 * @param boolean $exclude_subscribed_content707 * @param boolean $exclude_subscribed_content 734 708 * @param User $subscriber The User object used to discriminate the content 735 * @return an array of Content or an empty arrray */736 function getAllContent($exclude_subscribed_content = false, $subscriber = null)709 * @return an array of Content or an empty arrray */ 710 function getAllContent($exclude_subscribed_content = false, $subscriber = null) 737 711 { 738 712 global $db; 739 713 $retval = array (); 740 // Get all network, but exclude user subscribed content if asked741 if ($exclude_subscribed_content == true && $subscriber)742 $sql = "SELECT content_id FROM node_has_content WHERE node_id='$this->id' AND content_id NOT IN (SELECT content_id FROM user_has_content WHERE user_id = '{$subscriber->getId()}') ORDER BY subscribe_timestamp";743 else744 $sql = "SELECT content_id FROM node_has_content WHERE node_id='$this->id' ORDER BY subscribe_timestamp";714 // Get all network, but exclude user subscribed content if asked 715 if ($exclude_subscribed_content == true && $subscriber) 716 $sql = "SELECT content_id FROM node_has_content WHERE node_id='$this->id' AND content_id NOT IN (SELECT content_id FROM user_has_content WHERE user_id = '{$subscriber->getId()}') ORDER BY subscribe_timestamp"; 717 else 718 $sql = "SELECT content_id FROM node_has_content WHERE node_id='$this->id' ORDER BY subscribe_timestamp"; 745 719 $db->ExecSql($sql, $content_rows, false); 746 720 747 721 if ($content_rows != null) 748 722 { … … 754 728 return $retval; 755 729 } 756 757 /** Get an array of all artistic and locative Content for this hotspot758 * @return an array of Content or an empty arrray */759 function getAllLocativeArtisticContent()760 {761 global $db;762 $retval = array ();763 $sql = "SELECT * FROM content_group JOIN content ON (content.content_id = content_group.content_group_id) JOIN node_has_content ON (node_has_content.content_id = content_group.content_group_id AND node_has_content.node_id = '{$this->getId()}') WHERE is_persistent = true AND is_artistic_content = true AND is_locative_content = true";764 $db->ExecSql($sql, $content_rows, false);765 if ($content_rows != null)766 {767 foreach ($content_rows as $content_row)768 {769 // Create a content group object and grab only those that have content for the current Node770 $content_group = Content::getObject($content_row['content_group_id']);771 if($content_group->getDisplayNumElements() >= 1)772 {773 if($content_group->isDisplayableAt($this))774 {730 731 /** Get an array of all artistic and locative Content for this hotspot 732 * @return an array of Content or an empty arrray */ 733 function getAllLocativeArtisticContent() 734 { 735 global $db; 736 $retval = array (); 737 $sql = "SELECT * FROM content_group JOIN content ON (content.content_id = content_group.content_group_id) JOIN node_has_content ON (node_has_content.content_id = content_group.content_group_id AND node_has_content.node_id = '{$this->getId()}') WHERE is_persistent = true AND is_artistic_content = true AND is_locative_content = true"; 738 $db->ExecSql($sql, $content_rows, false); 739 if ($content_rows != null) 740 { 741 foreach ($content_rows as $content_row) 742 { 743 // Create a content group object and grab only those that have content for the current Node 744 $content_group = Content :: getObject($content_row['content_group_id']); 745 if ($content_group->getDisplayNumElements() >= 1) 746 { 747 if ($content_group->isDisplayableAt($this)) 748 { 775 749 // Disable logging and allow content to expand ( if possible ) 776 750 $content_group->setExpandStatus(true); 777 751 $content_group->setLoggingStatus(false); 778 752 $retval[] = $content_group; 779 }780 }781 }782 }783 return $retval;784 }753 } 754 } 755 } 756 } 757 return $retval; 758 } 785 759 786 760 /** Return all the nodes … … 837 811 } 838 812 839 /** The list of users online at this node840 * @return An array of User object, or en empty array */813 /** The list of users online at this node 814 * @return An array of User object, or en empty array */ 841 815 function getOnlineUsers() 842 816 { 843 817 global $db; 844 $retval =array();818 $retval = array (); 845 819 $db->ExecSql("SELECT users.user_id FROM users,connections WHERE connections.token_status='".TOKEN_INUSE."' AND users.user_id=connections.user_id AND connections.node_id='{$this->id}'", $users, false); 846 if ($users != null)820 if ($users != null) 847 821 { 848 822 foreach ($users as $user_row) 849 823 { 850 $retval[] = User ::getObject($user_row['user_id']);824 $retval[] = User :: getObject($user_row['user_id']); 851 825 } 852 826 } … … 855 829 856 830 function getOwners() 857 { 858 global $db; 859 $retval = array ();831 { 832 global $db; 833 $retval = array (); 860 834 $db->ExecSql("SELECT user_id FROM node_owners WHERE node_id='{$this->id}'", $owners, false); 861 if ($owners != null)835 if ($owners != null) 862 836 { 863 837 foreach ($owners as $owner_row) 864 838 { 865 $retval[] = User ::getObject($owner_row['user_id']);839 $retval[] = User :: getObject($owner_row['user_id']); 866 840 } 867 841 } … … 910 884 } 911 885 912 /** Warning, the semantics of this function will change *913 * @deprecated version - 2005-04-29 USE getOnlineUsers instead914 * */886 /** Warning, the semantics of this function will change * 887 * @deprecated version - 2005-04-29 USE getOnlineUsers instead 888 * */ 915 889 public static function getAllOnlineUsers() 916 890 { … … 919 893 return $online_users; 920 894 } 921 895 922 896 /** Reloads the object from the database. Should normally be called after a set operation */ 923 897 protected function refresh() -
trunk/wifidog-auth/wifidog/config.php
r672 r685 65 65 define('SMARTY_REL_PATH', 'lib/smarty/'); 66 66 define('PHLICKR_REL_PATH', 'lib/'); 67 //define('NETWORK_RSS_URL', 'http://wifinetnews.com/index.rdf'); 68 define('NETWORK_RSS_URL', 'http://www.ilesansfil.org/tiki-articles_rss.php?ver=2, http://auth.ilesansfil.org/hotspot_status.php?format=RSS'); 69 define('UNKNOWN_HOTSPOT_RSS_URL', ''); 67 //DEPRECATED, use the new RssAggregator content type define('NETWORK_RSS_URL', 'http://wifinetnews.com/index.rdf'); 68 //DEPRECATED, use the new RssAggregator content type define('UNKNOWN_HOTSPOT_RSS_URL', ''); 70 69 71 70 define('LOCAL_CONTENT_REL_PATH', 'local_content/');//Path to the directory containing the different node specific directories. Relative to BASE_URL_PATH -
trunk/wifidog-auth/wifidog/include/common.php
r672 r685 4 4 require_once BASEPATH.'classes/AbstractDb.php'; 5 5 require_once BASEPATH.'classes/Session.php'; 6 require_once BASEPATH.'include/schema_validate.php'; 6 7 7 global $db; 8 8 $db = new AbstractDb(); 9 validate_schema();10 9 11 10 /* NEVER edit these, as they mush match the C code of the gateway */ -
trunk/wifidog-auth/wifidog/include/schema_validate.php
r659 r685 27 27 require_once BASEPATH.'classes/AbstractDb.php'; 28 28 require_once BASEPATH.'classes/Session.php'; 29 define('REQUIRED_SCHEMA_VERSION', 2 0);29 define('REQUIRED_SCHEMA_VERSION', 21); 30 30 31 31 /** Check that the database schema is up to date. If it isn't, offer to update it. */ … … 473 473 } 474 474 475 476 $new_schema_version = 21; 477 if($schema_version < $new_schema_version) 478 { 479 echo "<h2>Preparing SQL statements to update schema to version $new_schema_version</h2>\n"; 480 $sql .= "\n\nUPDATE schema_info SET value='$new_schema_version' WHERE tag='schema_version';\n"; 481 $sql .= "CREATE TABLE content_rss_aggregator " . 482 "( " . 483 "content_id text NOT NULL PRIMARY KEY REFERENCES content ON UPDATE CASCADE ON DELETE CASCADE, " . 484 "number_of_display_items integer NOT NULL DEFAULT 10, " . 485 "algorithm_strength real NOT NULL DEFAULT 0.75, ". 486 "max_item_age interval DEFAULT NULL". 487 ");\n"; 488 $sql .= "CREATE TABLE content_rss_aggregator_feeds " . 489 "( " . 490 "content_id text NOT NULL REFERENCES content_rss_aggregator ON UPDATE CASCADE ON DELETE CASCADE, " . 491 "url text, ". 492 "bias real NOT NULL DEFAULT 1, ". 493 "default_publication_interval int DEFAULT NULL, ". 494 "PRIMARY KEY(content_id, url) " . 495 ");\n"; 496 $sql .= "ALTER TABLE content_has_owners ALTER COLUMN is_author SET DEFAULT 'f';\n"; 497 $results=null; 498 $db->ExecSql("SELECT node_id, rss_url FROM nodes", $results, false); 499 foreach ($results as $row) 500 { 501 if(!empty($row['rss_url'])) 502 { 503 //$user_id = $db->EscapeString($row['user_id']); 504 $content_id = get_guid(); 505 $sql .= "\nINSERT INTO content (content_id, content_type) VALUES ('$content_id', 'RssAggregator');\n"; 506 $sql .= "INSERT INTO content_rss_aggregator (content_id) VALUES ('$content_id');\n"; 507 $sql .= "INSERT INTO content_rss_aggregator_feeds (content_id, url) VALUES ('$content_id', '".$row['rss_url']."');\n"; 508 $node = Node::getObject ($row['node_id']); 509 $owners = $node->getOwners(); 510 foreach ($owners as $owner) 511 { 512 $sql .= "INSERT INTO content_has_owners (content_id, user_id) VALUES ('$content_id', '".$owner->getId()."');\n"; 513 } 514 $sql .= "INSERT INTO node_has_content (content_id, node_id) VALUES ('$content_id', '".$row['node_id']."');\n"; 515 } 516 } 517 $sql .= "\nALTER TABLE nodes DROP COLUMN rss_url;\n"; 518 $sql .= "\nDELETE FROM content WHERE content_type='HotspotRss';\n"; 519 520 521 } 475 522 $db->ExecSqlUpdate("BEGIN;\n$sql\nCOMMIT;\n", true); 523 //$db->ExecSqlUpdate("BEGIN;\n$sql\nROLLBACK;\n", true); 476 524 echo "</html></head>"; 477 525 exit (); -
trunk/wifidog-auth/wifidog/local_content/default/stylesheet.css
r670 r685 4 4 padding: 0px; 5 5 font-family: arial, sans-serif; 6 color: #616756; 6 /*color: #616756;*/ 7 color: black; 7 8 /*font-size: 11px;*/ 8 9 font-size: small; … … 118 119 font-family: arial, sans-serif; 119 120 color: #88AA4B; 120 font-size: 11px;121 text-decoration: underline;122 121 } 123 122 a.administration {
