Changeset 685

Show
Ignore:
Timestamp:
08/12/05 16:30:46 (8 years ago)
Author:
benoitg
Message:

2005-08-12 Benoit Gr�goire <bock@…>

  • classes/MainUI.php: Move the call to schema_validate() in MainUI's constructor
  • lib/RssPressReview/RssPressReview.php: Finish rewrite. Move there to reflect it's independently maintained status
  • wifidog/classes/Content/HotspotRss.php: Delete the class, obsolete
  • wifidog/classes/Content/RssAggregator.php: Functionnal, but needs it's admin UI written.
  • wifidog/include/schema_validate.php: Create the table structure for the new RssAggregator?. Remove rss_url in nodes table, no longer needed. Move it's data to the new Content class.
Location:
trunk/wifidog-auth
Files:
3 added
2 removed
11 modified

Legend:

Unmodified
Added
Removed
  • trunk/wifidog-auth/ChangeLog

    r684 r685  
     12005-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         
    1102005-08-11 Francois Proulx <francois.proulx@gmail.com> 
    211        * Refactored the Admin UI. 
  • trunk/wifidog-auth/INSTALL

    r530 r685  
    1515-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. 
    1616 
    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 777 
     17-portal/cache/, and everything in tmp/smarty must be at least writable by your web server.  Run "sh permissions.sh" to set them 777 
    1818 
    1919Database: 
  • trunk/wifidog-auth/TODO

    r655 r685  
    1818spamgourmet.com 
    1919spammotel.com 
     20dodgeit.com 
    2021 
    2122-Make error messages much more visible, especially in lost password. 
  • trunk/wifidog-auth/sql/wifidog-postgres-initial-data.sql

    r606 r685  
    77SET client_encoding = 'UNICODE'; 
    88SET check_function_bodies = false; 
    9  
    10 SET SESSION AUTHORIZATION 'wifidog'; 
     9SET client_min_messages = warning; 
    1110 
    1211SET search_path = public, pg_catalog; 
    1312 
    1413-- 
    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 
    1715-- 
    1816 
     
    2321 
    2422-- 
     23-- PostgreSQL database dump complete 
     24-- 
     25 
     26-- 
    2527-- PostgreSQL database dump 
    2628-- 
     
    2830SET client_encoding = 'UNICODE'; 
    2931SET check_function_bodies = false; 
    30  
    31 SET SESSION AUTHORIZATION 'wifidog'; 
     32SET client_min_messages = warning; 
    3233 
    3334SET search_path = public, pg_catalog; 
    3435 
    3536-- 
    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 
    3838-- 
    3939 
     
    7575 
    7676-- 
     77-- PostgreSQL database dump complete 
     78-- 
     79 
     80-- 
    7781-- PostgreSQL database dump 
    7882-- 
     
    8084SET client_encoding = 'UNICODE'; 
    8185SET check_function_bodies = false; 
    82  
    83 SET SESSION AUTHORIZATION 'wifidog'; 
     86SET client_min_messages = warning; 
    8487 
    8588SET search_path = public, pg_catalog; 
    8689 
    8790-- 
    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 
    9092-- 
    9193 
     
    98100 
    99101 
     102-- 
     103-- PostgreSQL database dump complete 
     104-- 
     105 
    100106INSERT INTO nodes (node_id, name, rss_url) VALUES ('default', 'Unknown node', NULL); 
    101107-- 
     
    105111SET client_encoding = 'UNICODE'; 
    106112SET check_function_bodies = false; 
    107  
    108 SET SESSION AUTHORIZATION 'wifidog'; 
     113SET client_min_messages = warning; 
    109114 
    110115SET search_path = public, pg_catalog; 
    111116 
    112117-- 
    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 
    115119-- 
    116120 
    117 INSERT INTO schema_info (tag, value) VALUES ('schema_version', '13'); 
     121INSERT INTO schema_info (tag, value) VALUES ('schema_version', '21'); 
    118122 
     123 
     124-- 
     125-- PostgreSQL database dump complete 
     126-- 
    119127 
    120128-- 
     
    124132SET client_encoding = 'UNICODE'; 
    125133SET check_function_bodies = false; 
    126  
    127 SET SESSION AUTHORIZATION 'wifidog'; 
     134SET client_min_messages = warning; 
    128135 
    129136SET search_path = public, pg_catalog; 
    130137 
    131138-- 
    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 
    134140-- 
    135141 
     
    138144 
    139145 
     146-- 
     147-- PostgreSQL database dump complete 
     148-- 
     149 
    140150COMMIT; 
  • trunk/wifidog-auth/sql/wifidog-postgres-schema.sql

    r606 r685  
    55SET client_encoding = 'UNICODE'; 
    66SET check_function_bodies = false; 
    7  
    8 -- 
    9 -- TOC entry 2 (OID 0) 
     7SET client_min_messages = warning; 
     8 
     9-- 
    1010-- Name: wifidog; Type: DATABASE; Schema: -; Owner: wifidog 
    1111-- 
     
    1414 
    1515 
    16 \connect wifidog wifidog 
     16\connect wifidog 
    1717 
    1818SET client_encoding = 'UNICODE'; 
    1919SET check_function_bodies = false; 
     20SET client_min_messages = warning; 
     21 
     22-- 
     23-- Name: SCHEMA public; Type: COMMENT; Schema: -; Owner: postgres 
     24-- 
     25 
     26COMMENT ON SCHEMA public IS 'Standard public schema'; 
     27 
    2028 
    2129SET search_path = public, pg_catalog; 
    2230 
    23 -- 
    24 -- TOC entry 5 (OID 706679) 
    25 -- Name: administrators; Type: TABLE; Schema: public; Owner: wifidog 
     31SET default_tablespace = ''; 
     32 
     33SET default_with_oids = true; 
     34 
     35-- 
     36-- Name: administrators; Type: TABLE; Schema: public; Owner: wifidog; Tablespace:  
    2637-- 
    2738 
     
    3243 
    3344-- 
    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:  
    4646-- 
    4747 
     
    6464 
    6565-- 
    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:  
    17967-- 
    18068 
     
    18876    creation_timestamp timestamp without time zone DEFAULT now(), 
    18977    is_persistent boolean DEFAULT false, 
     78    long_description text, 
    19079    CONSTRAINT content_type_not_empty_string CHECK ((content_type <> ''::text)) 
    19180); 
     
    19382 
    19483-- 
    195 -- TOC entry 17 (OID 728688) 
    196 -- Name: content_has_owners; Type: TABLE; Schema: public; Owner: wifidog 
    197 -- 
    198  
    199 CREATE TABLE content_has_owners ( 
     84-- Name: content_display_log; Type: TABLE; Schema: public; Owner: wifidog; Tablespace:  
     85-- 
     86 
     87CREATE TABLE content_display_log ( 
     88    user_id text NOT NULL, 
    20089    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:  
    22398-- 
    22499 
     
    236111 
    237112-- 
    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:  
    240114-- 
    241115 
     
    250124 
    251125-- 
    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:  
    254127-- 
    255128 
     
    262135 
    263136-- 
    264 -- TOC entry 22 (OID 728790) 
    265 -- Name: user_has_content; Type: TABLE; Schema: public; Owner: wifidog 
    266 -- 
    267  
    268 CREATE TABLE user_has_content ( 
     137-- Name: content_has_owners; Type: TABLE; Schema: public; Owner: wifidog; Tablespace:  
     138-- 
     139 
     140CREATE TABLE content_has_owners ( 
     141    content_id text NOT NULL, 
    269142    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 
     152CREATE TABLE content_rss_aggregator ( 
    270153    content_id text NOT NULL, 
    271     subscribe_timestamp timestamp without time zone DEFAULT now() NOT NULL 
    272 ); 
    273  
    274  
    275 -- 
    276 -- TOC entry 23 (OID 728806) 
    277 -- Name: node_has_content; Type: TABLE; Schema: public; Owner: wifidog 
    278 -- 
    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 
     164CREATE TABLE content_rss_aggregator_feeds ( 
    282165    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 
     176CREATE 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 
     189CREATE 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:  
    302202-- 
    303203 
     
    319219    display_description boolean DEFAULT false NOT NULL, 
    320220    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 
     231CREATE 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 
     243CREATE 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 
     255CREATE 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 
     264CREATE 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 
     271SET default_with_oids = false; 
     272 
     273-- 
     274-- Name: node_deployment_status; Type: TABLE; Schema: public; Owner: wifidog; Tablespace:  
     275-- 
     276 
     277CREATE TABLE node_deployment_status ( 
     278    node_deployment_status character varying(32) NOT NULL 
     279); 
     280 
     281 
     282SET default_with_oids = true; 
     283 
     284-- 
     285-- Name: node_has_content; Type: TABLE; Schema: public; Owner: wifidog; Tablespace:  
     286-- 
     287 
     288CREATE 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 
     295SET default_with_oids = false; 
     296 
     297-- 
     298-- Name: node_owners; Type: TABLE; Schema: public; Owner: wifidog; Tablespace:  
     299-- 
     300 
     301CREATE TABLE node_owners ( 
     302    node_id character varying(32) NOT NULL, 
     303    user_id character varying(45) NOT NULL 
     304); 
     305 
     306 
     307SET default_with_oids = true; 
     308 
     309-- 
     310-- Name: nodes; Type: TABLE; Schema: public; Owner: wifidog; Tablespace:  
     311-- 
     312 
     313CREATE 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 
     341CREATE 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 
     352CREATE 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 
     362CREATE 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 
     371CREATE TABLE user_has_content ( 
    360372    user_id text NOT NULL, 
    361373    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 
     382CREATE 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 
     400SET default_with_oids = false; 
     401 
     402-- 
     403-- Name: venue_types; Type: TABLE; Schema: public; Owner: wifidog; Tablespace:  
     404-- 
     405 
     406CREATE 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 
     415CREATE 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:  
    403423-- 
    404424 
     
    408428 
    409429-- 
    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 
     433ALTER 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 
     441ALTER 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 
     449ALTER 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 
     457ALTER 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 
     465ALTER 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 
     473ALTER 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 
     481ALTER 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 
     489ALTER 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 
     497ALTER 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 
     505ALTER 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 
     513ALTER 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 
     521ALTER 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 
     529ALTER 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 
     537ALTER 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 
     545ALTER 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 
     553ALTER 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 
     561ALTER 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 
     569ALTER 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 
     577ALTER 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 
     585ALTER 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 
     593ALTER 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:  
    412599-- 
    413600 
     
    417604 
    418605-- 
    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 
     609ALTER 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:  
    439615-- 
    440616 
     
    444620 
    445621-- 
    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:  
    466623-- 
    467624 
     
    471628 
    472629-- 
    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 
     633CREATE 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 
     640CREATE 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 
     647CREATE 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 
     654CREATE UNIQUE INDEX idx_unique_username_and_account_origin ON users USING btree (username, account_origin); 
     655 
     656 
     657-- 
    600658-- Name: $1; Type: FK CONSTRAINT; Schema: public; Owner: wifidog 
    601659-- 
     
    606664 
    607665-- 
    608 -- TOC entry 55 (OID 728621) 
     666-- Name: $1; Type: FK CONSTRAINT; Schema: public; Owner: wifidog 
     667-- 
     668 
     669ALTER 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 
     677ALTER 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 
     685ALTER 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 
     693ALTER 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 
     701ALTER 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 
     709ALTER 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 
     717ALTER 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 
     725ALTER 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 
     733ALTER 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 
     741ALTER 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 
     749ALTER 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 
     757ALTER 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 
     765ALTER 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 
     773ALTER 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 
     781ALTER 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 
     789ALTER 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 
     797ALTER 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 
     805ALTER 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 
     813ALTER 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 
     821ALTER 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 
     829ALTER 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 
     837ALTER 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 
     845ALTER 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 
     853ALTER 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 
     861ALTER TABLE ONLY content 
     862    ADD CONSTRAINT "$5" FOREIGN KEY (long_description) REFERENCES content(content_id) ON UPDATE CASCADE ON DELETE RESTRICT; 
     863 
     864 
     865-- 
    609866-- Name: administrators_ibfk_1; Type: FK CONSTRAINT; Schema: public; Owner: wifidog 
    610867-- 
     
    615872 
    616873-- 
    617 -- TOC entry 57 (OID 728625) 
     874-- Name: content_rss_aggregator_content_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: wifidog 
     875-- 
     876 
     877ALTER 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 
     885ALTER 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 
     893ALTER 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 
     901ALTER 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 
     909ALTER 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-- 
    618914-- Name: fk_users; Type: FK CONSTRAINT; Schema: public; Owner: wifidog 
    619915-- 
     
    624920 
    625921-- 
    626 -- TOC entry 58 (OID 728629) 
    627 -- Name: fk_nodes; Type: FK CONSTRAINT; Schema: public; Owner: wifidog 
    628 -- 
    629  
    630 ALTER TABLE ONLY connections 
    631     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) 
    636922-- Name: fk_users; Type: FK CONSTRAINT; Schema: public; Owner: wifidog 
    637923-- 
     
    642928 
    643929-- 
    644 -- TOC entry 63 (OID 728637) 
    645 -- Name: fk_nodes; Type: FK CONSTRAINT; Schema: public; Owner: wifidog 
    646 -- 
    647  
    648 ALTER TABLE ONLY node_owners 
    649     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: wifidog 
    655 -- 
    656  
    657 ALTER TABLE ONLY nodes 
    658     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) 
    663930-- Name: fk_venue_types; Type: FK CONSTRAINT; Schema: public; Owner: wifidog 
    664931-- 
     
    669936 
    670937-- 
    671 -- TOC entry 61 (OID 728659) 
    672 -- Name: $1; Type: FK CONSTRAINT; Schema: public; Owner: wifidog 
    673 -- 
    674  
    675 ALTER TABLE ONLY users 
    676     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: wifidog 
    682 -- 
    683  
    684 ALTER TABLE ONLY content 
    685     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: wifidog 
    691 -- 
    692  
    693 ALTER TABLE ONLY content 
    694     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: wifidog 
    700 -- 
    701  
    702 ALTER TABLE ONLY content 
    703     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: wifidog 
    709 -- 
    710  
    711 ALTER TABLE ONLY content 
    712     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: wifidog 
    718 -- 
    719  
    720 ALTER TABLE ONLY content_has_owners 
    721     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: wifidog 
    727 -- 
    728  
    729 ALTER TABLE ONLY content_has_owners 
    730     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: wifidog 
    736 -- 
    737  
    738 ALTER TABLE ONLY langstring_entries 
    739     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: wifidog 
    745 -- 
    746  
    747 ALTER TABLE ONLY langstring_entries 
    748     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: wifidog 
    754 -- 
    755  
    756 ALTER TABLE ONLY content_group 
    757     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: wifidog 
    763 -- 
    764  
    765 ALTER TABLE ONLY content_group_element 
    766     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: wifidog 
    772 -- 
    773  
    774 ALTER TABLE ONLY content_group_element 
    775     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: wifidog 
    781 -- 
    782  
    783 ALTER TABLE ONLY content_group_element 
    784     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: wifidog 
    790 -- 
    791  
    792 ALTER TABLE ONLY content_group_element_has_allowed_nodes 
    793     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: wifidog 
    799 -- 
    800  
    801 ALTER TABLE ONLY content_group_element_has_allowed_nodes 
    802     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: wifidog 
    808 -- 
    809  
    810 ALTER TABLE ONLY user_has_content 
    811     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: wifidog 
    817 -- 
    818  
    819 ALTER TABLE ONLY user_has_content 
    820     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: wifidog 
    826 -- 
    827  
    828 ALTER TABLE ONLY node_has_content 
    829     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: wifidog 
    835 -- 
    836  
    837 ALTER TABLE ONLY node_has_content 
    838     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: wifidog 
    844 -- 
    845  
    846 ALTER TABLE ONLY network_has_content 
    847     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: wifidog 
    853 -- 
    854  
    855 ALTER TABLE ONLY content_display_log 
    856     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: wifidog 
    862 -- 
    863  
    864 ALTER TABLE ONLY content_display_log 
    865     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: wifidog 
    871 -- 
    872  
    873 ALTER TABLE ONLY content_display_log 
    874     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) 
    879938-- Name: flickr_photostream_content_fkey; Type: FK CONSTRAINT; Schema: public; Owner: wifidog 
    880939-- 
     
    885944 
    886945-- 
    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 
     949ALTER 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  
    2424require_once BASEPATH.'include/common.php'; 
    2525require_once BASEPATH.'include/common_interface.php'; 
     26 
    2627/** Style contains functions managing headers, footers, stylesheet, etc. 
    2728 */ 
     
    3435        private $html_headers; 
    3536        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 */  
    3641        function __construct() 
    3742        { 
     43                require_once BASEPATH.'include/schema_validate.php'; 
     44                validate_schema(); 
     45 
    3846                $this->smarty = new SmartyWifidog(); 
    3947                $this->title = Network :: getCurrentNetwork()->getName().' '._("authentication server"); //Default title 
  • trunk/wifidog-auth/wifidog/classes/Node.php

    r684 r685  
    11<?php 
     2 
    23/********************************************************************\ 
    34 * This program is free software; you can redistribute it and/or    * 
     
    2223 * @author Copyright (C) 2005 Benoit Gr�goire <bock@step.polymtl.ca> 
    2324 */ 
    24   
     25 
    2526require_once BASEPATH.'include/common.php'; 
    2627require_once 'Content/ContentGroup.php'; 
     
    5859                else 
    5960                { 
    60                         $object = self::getCurrentRealNode(); 
     61                        $object = self :: getCurrentRealNode(); 
    6162                } 
    6263                return $object; 
     
    109110                                        $db->ExecSql($sql, $node_rows, false); 
    110111                                        $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']) 
    112113                                        { 
    113114                                                $retval = new self($node_row['node_id']); 
     
    115116                                } 
    116117                        } 
    117         return $retval; 
     118                return $retval; 
    118119        } 
    119120 
     
    126127                        $errmsg = _('Access denied!'); 
    127128                } 
    128                  
     129 
    129130                global $db; 
    130131                $id = $db->EscapeString($this->getId()); 
     
    137138                        $retval = true; 
    138139                } 
    139                  
     140 
    140141                return $retval; 
    141142        } 
     
    174175                $node_id = $db->EscapeString($node_id); 
    175176                $name = $db->EscapeString($name); 
    176                 $rss_url = $db->EscapeString($rss_url); 
    177177                $home_page_url = $db->EscapeString($home_page_url); 
    178178                $description = $db->EscapeString($description); 
     
    187187                        throw new Exception(_('This node already exists.')); 
    188188 
    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')"; 
    190190 
    191191                if (!$db->ExecSqlUpdate($sql, false)) 
     
    234234                return new self($_REQUEST[$name]); 
    235235        } 
    236          
     236 
    237237        /** Get an interface to select the deployment status 
    238238        * @param $user_prefix A identifier provided by the programmer to recognise it's generated html form 
     
    244244                $html = ''; 
    245245                $name = "{$user_prefix}"; 
    246                 $status_list = self::getAllDeploymentStatus(); 
     246                $status_list = self :: getAllDeploymentStatus(); 
    247247                if ($status_list != null) 
    248248                { 
    249                         $tab = array(); 
     249                        $tab = array (); 
    250250                        foreach ($status_list as $status) 
    251                                 $tab[] = array($status, $status); 
     251                                $tab[] = array ($status, $status); 
    252252                        $html .= FormSelectGenerator :: generateFromArray($tab, $this->getDeploymentStatus(), $name, null, false); 
    253253                } 
     
    279279                } 
    280280                $this->mRow = $row; 
    281                 $this->mDb = &$db; 
     281                $this->mDb = & $db; 
    282282                $this->id = $row['node_id']; 
    283283        } 
    284          
     284 
    285285        function getID() 
    286286        { 
    287287                return $this->mRow['node_id']; 
    288288        } 
    289          
     289 
    290290        /** Return the name of the node  
    291291         */ 
     
    294294                return $this->mRow['name']; 
    295295        } 
    296          
     296 
    297297        function setName($name) 
    298298        { 
     
    302302        } 
    303303 
    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  
    316304        function getHomePageURL() 
    317305        { 
    318306                return $this->mRow['home_page_url']; 
    319307        } 
    320          
     308 
    321309        function setHomePageUrl($url) 
    322310        { 
     
    330318                return $this->mRow['description']; 
    331319        } 
    332          
     320 
    333321        function setDescription($description) 
    334322        { 
     
    342330                return $this->mRow['map_url']; 
    343331        } 
    344          
     332 
    345333        function setMapURL($url) 
    346334        { 
     
    354342                return $this->mRow['street_address']; 
    355343        } 
    356          
     344 
    357345        function setAddress($address) 
    358346        { 
     
    366354                return $this->mRow['public_phone_number']; 
    367355        } 
    368          
     356 
    369357        function setTelephone($phone) 
    370358        { 
     
    378366                return $this->mRow['mass_transit_info']; 
    379367        } 
    380          
     368 
    381369        function setTransitInfo($transit_info) 
    382370        { 
     
    390378                return $this->mRow['public_email']; 
    391379        } 
    392          
     380 
    393381        function setEmail($email) 
    394382        { 
     
    402390                return $this->mRow['node_deployment_status']; 
    403391        } 
    404          
     392 
    405393        function setDeploymentStatus($status) 
    406394        { 
     
    415403        { 
    416404                //TODO: Most of this code will be moved to Hotspot class when the abtraction will be completed 
    417                  
     405 
    418406                $html = ''; 
    419407                $html .= "<div class='admin_container'>\n"; 
    420408                $html .= "<div class='admin_class'>Node (".get_class($this)." instance)</div>\n"; 
    421409                $html .= "<h3>"._("Edit a hotspot")."</h3>\n"; 
    422                  
     410 
    423411                // Information about the node 
    424412                $html .= "<div class='admin_section_container'>\n"; 
    425413                $html .= "<div class='admin_section_title'>"._("Information about the node:")."</div>\n"; 
    426                  
     414 
    427415                // Node ID 
    428416                $html .= "<div class='admin_section_container'>\n"; 
     
    444432                $html .= "</div>\n"; 
    445433                $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 
    457435                // Homepage URL 
    458436                $html .= "<div class='admin_section_container'>\n"; 
     
    464442                $html .= "</div>\n"; 
    465443                $html .= "</div>\n"; 
    466                  
     444 
    467445                // Description 
    468446                $html .= "<div class='admin_section_container'>\n"; 
     
    474452                $html .= "</div>\n"; 
    475453                $html .= "</div>\n"; 
    476                  
     454 
    477455                // Map URL 
    478456                $html .= "<div class='admin_section_container'>\n"; 
     
    484462                $html .= "</div>\n"; 
    485463                $html .= "</div>\n"; 
    486                  
     464 
    487465                // Street address 
    488466                $html .= "<div class='admin_section_container'>\n"; 
     
    494472                $html .= "</div>\n"; 
    495473                $html .= "</div>\n"; 
    496                  
     474 
    497475                // Public phone # 
    498476                $html .= "<div class='admin_section_container'>\n"; 
     
    504482                $html .= "</div>\n"; 
    505483                $html .= "</div>\n"; 
    506                  
     484 
    507485                // Public mail 
    508486                $html .= "<div class='admin_section_container'>\n"; 
     
    514492                $html .= "</div>\n"; 
    515493                $html .= "</div>\n"; 
    516                  
     494 
    517495                // Mass transit info 
    518496                $html .= "<div class='admin_section_container'>\n"; 
     
    524502                $html .= "</div>\n"; 
    525503                $html .= "</div>\n"; 
    526                  
     504 
    527505                // Deployment status 
    528506                $html .= "<div class='admin_section_container'>\n"; 
    529507                $html .= "<div class='admin_section_title'>"._("Node deployment status")." : </div>\n"; 
    530508                $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 
    536514                // End of information section 
    537515                $html .= "</div>\n"; 
    538                  
     516 
    539517                // Owners management 
    540518                $html .= "<div class='admin_section_container'>\n"; 
     
    562540                $html .= "</div>\n"; 
    563541                $html .= "</div>\n"; 
    564                  
     542 
    565543                // Display stats 
    566544                $html .= "<div class='admin_section_container'>\n"; 
     
    571549                $html .= "</div>\n"; 
    572550                $html .= "</div>\n"; 
    573                  
     551 
    574552                $html .= "<div class='admin_section_container'>\n"; 
    575553                $html .= "<div class='admin_section_title'>"._("Node content:")."</div>\n"; 
     
    604582        public function processAdminUI() 
    605583        { 
    606                 $user = User::getCurrentUser(); 
     584                $user = User :: getCurrentUser(); 
    607585                if (!$this->isOwner($user) && !$user->isSuperAdmin()) 
    608586                { 
    609587                        throw new Exception(_('Access denied!')); 
    610588                } 
    611                  
     589 
    612590                // Information about the node 
    613                  
     591 
    614592                // Name 
    615593                $name = "node_".$this->getId()."_name"; 
    616594                $this->setName($_REQUEST[$name]); 
    617                  
    618                 // RSS URL 
    619                 $name = "node_".$this->getId()."_rss_url"; 
    620                 $this->setRssUrl($_REQUEST[$name]); 
    621                          
     595 
    622596                // Homepage URL 
    623597                $name = "node_".$this->getId()."_homepage_url"; 
    624598                $this->setHomePageUrl($_REQUEST[$name]); 
    625                  
     599 
    626600                // Description 
    627601                $name = "node_".$this->getId()."_description"; 
    628602                $this->setDescription($_REQUEST[$name]); 
    629                  
     603 
    630604                // Map URL 
    631605                $name = "node_".$this->getId()."_map_url"; 
    632606                $this->setMapUrl($_REQUEST[$name]); 
    633                  
     607 
    634608                // Street address 
    635609                $name = "node_".$this->getId()."_street_address"; 
    636610                $this->setAddress($_REQUEST[$name]); 
    637                  
     611 
    638612                // Public phone # 
    639613                $name = "node_".$this->getId()."_public_phone"; 
    640614                $this->setTelephone($_REQUEST[$name]); 
    641                  
     615 
    642616                // Public mail 
    643617                $name = "node_".$this->getId()."_public_email"; 
    644618                $this->setEmail($_REQUEST[$name]); 
    645                  
     619 
    646620                // Mass transit info 
    647621                $name = "node_".$this->getId()."_mass_transit_info"; 
    648622                $this->setTransitInfo($_REQUEST[$name]); 
    649                  
     623 
    650624                // Deployment status 
    651625                $name = "node_".$this->getId()."_deployment_status"; 
    652                 $this->setDeploymentStatus(self::processSelectDeploymentStatus($name)); 
     626                $this->setDeploymentStatus(self :: processSelectDeploymentStatus($name)); 
    653627 
    654628                // Statistics 
     
    656630                if (!empty ($_REQUEST[$name])) 
    657631                        header("Location: hotspot_log.php?node_id=".urlencode($this->getId())); 
    658                          
     632 
    659633                // Owners processing 
    660634                // Rebuild user id, and delete if it was selected 
     
    664638                        if (!empty ($_REQUEST[$name])) 
    665639                        { 
    666                                 if($this->isOwner($owner)) 
     640                                if ($this->isOwner($owner)) 
    667641                                        $this->removeOwner($owner); 
    668642                                else 
     
    676650                        $name = "node_{$this->getId()}_new_owner"; 
    677651                        $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                 else 
    683                         $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 
    687661                // Content processing  
    688662                // Rebuild content id and deleting if it was selected for deletion ) 
     
    701675                        $name = "node_{$this->id}_new_content"; 
    702676                        $content = Content :: processSelectContentUI($name); 
    703             if($content) 
    704                 $this->addContent($content); 
    705                 } 
    706         } 
    707      
    708     // Redirect to this node's portal page 
    709     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        } 
    713687 
    714688        /** Add content to this node */ 
     
    731705 
    732706        /**Get an array of all Content linked to this node 
    733     * @param boolean $exclude_subscribed_content 
     707        * @param boolean $exclude_subscribed_content 
    734708        * @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) 
    737711        { 
    738712                global $db; 
    739713                $retval = array (); 
    740         // Get all network, but exclude user subscribed content if asked 
    741         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         else 
    744             $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"; 
    745719                $db->ExecSql($sql, $content_rows, false); 
    746          
     720 
    747721                if ($content_rows != null) 
    748722                { 
     
    754728                return $retval; 
    755729        } 
    756      
    757     /** Get an array of all artistic and locative Content for this hotspot 
    758     * @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 Node 
    770                 $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                                        { 
    775749                                                // Disable logging and allow content to expand ( if possible ) 
    776750                                                $content_group->setExpandStatus(true); 
    777751                                                $content_group->setLoggingStatus(false); 
    778752                                                $retval[] = $content_group; 
    779                         } 
    780                 } 
    781             } 
    782         } 
    783         return $retval; 
    784     } 
     753                                        } 
     754                                } 
     755                        } 
     756                } 
     757                return $retval; 
     758        } 
    785759 
    786760        /** Return all the nodes 
     
    837811        } 
    838812 
    839     /** The list of users online at this node 
    840     * @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 */ 
    841815        function getOnlineUsers() 
    842816        { 
    843817                global $db; 
    844                 $retval=array(); 
     818                $retval = array (); 
    845819                $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) 
    847821                { 
    848822                        foreach ($users as $user_row) 
    849823                        { 
    850                                 $retval[] = User::getObject($user_row['user_id']); 
     824                                $retval[] = User :: getObject($user_row['user_id']); 
    851825                        } 
    852826                } 
     
    855829 
    856830        function getOwners() 
    857         {                
    858                 global $db; 
    859                 $retval = array(); 
     831        { 
     832                global $db; 
     833                $retval = array (); 
    860834                $db->ExecSql("SELECT user_id FROM node_owners WHERE node_id='{$this->id}'", $owners, false); 
    861                 if($owners != null) 
     835                if ($owners != null) 
    862836                { 
    863837                        foreach ($owners as $owner_row) 
    864838                        { 
    865                                 $retval[] = User::getObject($owner_row['user_id']); 
     839                                $retval[] = User :: getObject($owner_row['user_id']); 
    866840                        } 
    867841                } 
     
    910884        } 
    911885 
    912     /** Warning, the semantics of this function will change * 
    913     * @deprecated version - 2005-04-29 USE getOnlineUsers instead 
    914     * */ 
     886        /** Warning, the semantics of this function will change * 
     887        * @deprecated version - 2005-04-29 USE getOnlineUsers instead 
     888        * */ 
    915889        public static function getAllOnlineUsers() 
    916890        { 
     
    919893                return $online_users; 
    920894        } 
    921          
     895 
    922896        /** Reloads the object from the database.  Should normally be called after a set operation */ 
    923897        protected function refresh() 
  • trunk/wifidog-auth/wifidog/config.php

    r672 r685  
    6565define('SMARTY_REL_PATH',  'lib/smarty/'); 
    6666define('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', ''); 
    7069 
    7170define('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  
    44require_once BASEPATH.'classes/AbstractDb.php'; 
    55require_once BASEPATH.'classes/Session.php'; 
    6 require_once BASEPATH.'include/schema_validate.php'; 
     6 
    77global $db; 
    88$db = new AbstractDb(); 
    9 validate_schema(); 
    109 
    1110/* NEVER edit these, as they mush match the C code of the gateway */ 
  • trunk/wifidog-auth/wifidog/include/schema_validate.php

    r659 r685  
    2727require_once BASEPATH.'classes/AbstractDb.php'; 
    2828require_once BASEPATH.'classes/Session.php'; 
    29 define('REQUIRED_SCHEMA_VERSION', 20); 
     29define('REQUIRED_SCHEMA_VERSION', 21); 
    3030 
    3131/** Check that the database schema is up to date.  If it isn't, offer to update it. */ 
     
    473473        } 
    474474         
     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        } 
    475522                $db->ExecSqlUpdate("BEGIN;\n$sql\nCOMMIT;\n", true); 
     523                //$db->ExecSqlUpdate("BEGIN;\n$sql\nROLLBACK;\n", true); 
    476524                echo "</html></head>"; 
    477525                exit (); 
  • trunk/wifidog-auth/wifidog/local_content/default/stylesheet.css

    r670 r685  
    44        padding: 0px; 
    55        font-family: arial, sans-serif; 
    6         color: #616756; 
     6        /*color: #616756;*/ 
     7color: black; 
    78        /*font-size: 11px;*/ 
    89        font-size: small; 
     
    118119        font-family: arial, sans-serif; 
    119120        color: #88AA4B; 
    120         font-size: 11px; 
    121         text-decoration: underline; 
    122121} 
    123122a.administration {