root/trunk/wifidog-auth/wifidog/content/index.php @ 708

Revision 708, 4.1 KB (checked in by benoitg, 8 years ago)

2005-09-01 Benoit Gr�goire <bock@…>

WARNING: DO NOT use the CVS auth server in production until further notice.
Massive internal changes are underway.
Use the release tagged 1.0m1 in production.

  • Network abstraction mostly complete, including UI. All that is missing is new network creation, network stakeholder UI and testing.
  • Cleanup the config file of all the now unneeded constants. Note that the install script is currently broken. There can now be multiple networks on the server. The install script will have to make sure that there is at least one, with one super-admin
  • Property svn:eol-style set to native
  • Property svn:executable set to *
  • Property svn:keywords set to Author Date Id Revision
Line 
1<?php
2/********************************************************************\
3 * This program is free software; you can redistribute it and/or    *
4 * modify it under the terms of the GNU General Public License as   *
5 * published by the Free Software Foundation; either version 2 of   *
6 * the License, or (at your option) any later version.              *
7 *                                                                  *
8 * This program is distributed in the hope that it will be useful,  *
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of   *
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the    *
11 * GNU General Public License for more details.                     *
12 *                                                                  *
13 * You should have received a copy of the GNU General Public License*
14 * along with this program; if not, contact:                        *
15 *                                                                  *
16 * Free Software Foundation           Voice:  +1-617-542-5942       *
17 * 59 Temple Place - Suite 330        Fax:    +1-617-542-2652       *
18 * Boston, MA  02111-1307,  USA       gnu@gnu.org                   *
19 *                                                                  *
20 \********************************************************************/
21/**@file index.php Displays all the content associated to a hotspot
22 * @author Copyright (C) 2005 François Proulx
23 */
24
25define('BASEPATH', '../');
26require_once BASEPATH.'include/common.php';
27require_once BASEPATH.'classes/MainUI.php';
28require_once BASEPATH.'include/common_interface.php';
29require_once BASEPATH.'classes/Node.php';
30
31if (CONF_USE_CRON_FOR_DB_CLEANUP == false)
32{
33        garbage_collect();
34}
35
36$node = null;
37if(!empty($_REQUEST['gw_id']))
38    $node = Node :: getObject($_REQUEST['gw_id']);
39
40if ($node == null)
41{
42        $smarty->display("templates/message_unknown_hotspot.html");
43        exit;
44}
45
46$node_id = $node->getId();
47$portal_template = $node_id.".html";
48Node :: setCurrentNode($node);
49
50$ui = new MainUI();
51if (isset ($session))
52{
53        $smarty->assign("original_url_requested", $session->get(SESS_ORIGINAL_URL_VAR));
54}
55
56$tool_html = '';
57
58$tool_html .= "<h1>"._("Online users")."</h1>"."\n";
59$tool_html .= '<p class="indent">'."\n";
60$current_node = Node :: getCurrentNode();
61if ($current_node != null)
62{
63    $current_node_id = $current_node->getId();
64    $online_users = $current_node->getOnlineUsers();
65    $num_online_users = count($online_users);
66    if ($num_online_users > 0)
67    {
68        //$tool_html .= $num_online_users.' '._("other users online at this hotspot...");
69        $tool_html .= "<ul class='users_list'>\n";
70        foreach($online_users as $online_user)
71            $tool_html .= "<li>{$online_user->getUsername()}</li>\n";
72        $tool_html .= "</ul>\n";
73    }
74    else
75    {
76        $tool_html .= _("Nobody is online at this hotspot...");
77    }
78}
79else
80{
81    $current_node_id = null;
82    $tool_html .= _("You are not currently at a hotspot...");
83}
84$tool_html .= "</p>"."\n";
85
86
87/*
88$tool_html .= '<p class="indent">'."\n";
89$tool_html .= "<a href='content.php?gw_id={$current_node_id}' target='_blank.right'><img src='/images/start.gif'></a>"."\n";
90$tool_html .= "</p>"."\n";
91*/
92$ui->setToolContent($tool_html);
93
94$hotspot_logo_url = find_local_content_url(HOTSPOT_LOGO_NAME);
95
96$html = '';
97$html .= "<div id='portal_container'>\n";
98
99/* Node section */
100// Get all locative artistic content for this node
101$contents = $node->getAllLocativeArtisticContent();
102if($contents)
103{
104        $html .= "<table width='100%'><tr><td>";
105        $html .= "<div class='portal_node_section'>\n";
106        $html .= "<img class='portal_section_logo' src='{$hotspot_logo_url}' alt=''>\n";
107        $html .= "<span class='portal_section_title'>"._("Content from:")." ";
108       
109        $node_homepage = $node->getHomePageURL();
110        if(!empty($node_homepage))
111        {
112                $html .= "<a href='$node_homepage'>";
113        }
114        $html .= $node->getName();
115        if(!empty($node_homepage))
116        {
117                $html .= "</a>\n";
118        }
119        $html .= "</span>";
120        $html .= "</td></tr></table>";
121       
122        foreach ($contents as $content)
123        {
124                $html .= "<div class='portal_content'>\n";
125                $html .= $content->getUserUI();
126                $html .= "</div>";
127        }
128        $html .= "</div>\n";
129}
130
131$ui->setMainContent($html);
132$ui->display();
133
134?>
Note: See TracBrowser for help on using the browser.