chdir ${1:-.}
-dirs=(bin configs htdocs hooks include plugins templates)
+dirs=(bin configs htdocs hooks include plugins scripts templates)
opts=(-type f -not -path '*CVS*' -not -name '.cvsignore' -not -path '*.arch*')
diff -u <(cat install.d/**/files|sort) <(find $dirs $opts|sort) \
***************************************************************************/
require_once("xorg.inc.php");
-new_skinned_page('carva_redirect.tpl', AUTH_MDP);
+new_skinned_page('webredirect.tpl', AUTH_MDP);
if (isset($_REQUEST['submit']) and ($_REQUEST['submit'] == "Valider" or $_REQUEST['submit'] == "Modifier") and isset($_REQUEST['url'])) {
// on change la redirection (attention à http://)
- $globals->db->query("update auth_user_md5 set redirecturl = '{$_REQUEST['url']}'"
+ $globals->db->query("update auth_user_quick set redirecturl = '{$_REQUEST['url']}'"
." where user_id = '{$_SESSION['uid']}'");
if (mysql_errno($conn) == 0) {
$_SESSION['log']->log("carva_add","http://".$_REQUEST['url']);
}
} elseif (isset($_REQUEST['submit']) and $_REQUEST['submit'] == "Supprimer") {
// on supprime la redirection
- $globals->db->query("update auth_user_md5 set redirecturl = '' where user_id = {$_SESSION['uid']}");
+ $globals->db->query("update auth_user_quick set redirecturl = '' where user_id = {$_SESSION['uid']}");
if (mysql_errno($conn) == 0) {
$_SESSION['log']->log("carva_del",$_REQUEST['url']);
$_POST['url'] = '';
}
-$result = $globals->db->query("select redirecturl from auth_user_md5 where user_id={$_SESSION['uid']}");
+$result = $globals->db->query("select redirecturl from auth_user_quick where user_id={$_SESSION['uid']}");
list($carva) = mysql_fetch_row($result);
mysql_free_result($result);
$page->assign('carva', $carva);
--- /dev/null
+<?php
+/***************************************************************************
+ * Copyright (C) 2003-2004 Polytechnique.org *
+ * http://opensource.polytechnique.org/ *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ * This program is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
+ * GNU General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU General Public License *
+ * along with this program; if not, write to the Free Software *
+ * Foundation, Inc., *
+ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA *
+ ***************************************************************************/
+
+// {{{ class WebRedirConfig
+
+class WebRedirConfig
+{
+ var $domain = '';
+}
+
+// }}}
+
+$this->webredirect = new WebRedirConfig;
+
+// vim:set et sw=4 sts=4 sws=4 foldmethod=marker:
+?>
function _new_page($type, $tpl_name, $tpl_head, $min_auth, $admin=false)
{
- global $page;
+ global $page,$globals;
require_once("xorg.page.inc.php");
if (!empty($admin)) {
$page = new XorgAdmin($tpl_name, $type);
function new_simple_page($tpl_name, $min_auth, $tpl_head="")
{
- global $page;
+ global $page,$globals;
_new_page(SKINNED, $tpl_name, $tpl_head, $min_auth);
$page->assign('simple', true);
}
only one minor bug
+webredirect
STILL NEED SOME WORK
--------------------
register
search
stats
-web-redirect
xorg-stuff
+++ /dev/null
-htdocs/carva_redirect.php
-bin/carva/error.php
-bin/carva/redirect.php
-templates/carva_redirect.tpl
-templates/preferences.tpl.d/30.redirect.tpl
--- /dev/null
+
+ Notes for the webredirect module for plat/al
+
+
+CONFIG OPTIONS
+--------------
+
+ All settings of the module are shown here with their default and meaning
+
+ [WebRedirect]
+
+ domain = '' ; the domain used for web redirections.
+
+
+BUGS
+----
+
+ http://trackers.polytechnique.org/index.php?cat=13
+
+
+DEPENDS
+-------
+
+ platal
+
+
--- /dev/null
+htdocs/webredirect.php
+include/conf.d/webredirect.globals.inc.php
+scripts/webredirect_error.php
+scripts/webredirect.php
+templates/webredirect.tpl
+templates/preferences.tpl.d/80.webredirect.tpl
--- /dev/null
+
+alter table auth_user_quick add column redirecturl varchar(255) not null;
+
--- /dev/null
+
+alter table auth_user_quick drop column webredirect;
+
// REQUEST_URI = /prenom.nom(/path/fichier.hmtl)?
list($username, $path) = preg_split('/\//', $_SERVER["REQUEST_URI"], 2, PREG_SPLIT_NO_EMPTY);
-$result = mysql_query("SELECT redirecturl FROM auth_user_md5 AS a INNER JOIN aliases AS al ON (al.id = a.user_id AND (al.type='a_vie' OR al.type='alias' OR al.type='epouse')) where al.alias= '$username'");
+$result = mysql_query("SELECT redirecturl FROM auth_user_quick AS a INNER JOIN aliases AS al ON (al.id = a.user_id AND (al.type='a_vie' OR al.type='alias' OR al.type='epouse')) where al.alias= '$username'");
if ($result and list($url) = mysql_fetch_row($result) and $url != '') {
// on envoie un redirect (PHP met automatiquement le code de retour 302
if (!empty($path)) {
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA *
***************************************************************************}
-<h3><a href="{rel}/carva_redirect.php">Ma redirection de page WEB</a></h3>
+<h3><a href="{rel}/webredirect.php">Ma redirection de page WEB</a></h3>
<div class='explication'>
Tu peux configurer tes redirections WEB
http://www.carva.org/{dyn s=$smarty.session.bestalias}
Dans la lignée du service de redirection d'emails de <strong>Polytechnique.org</strong>,
il est possible de faire pointer
{dynamic}
- les adresses <strong>http://www.carva.org/{$smarty.session.bestalias}</strong>
- et <strong>http://www.carva.org/{$smarty.session.forlife}</strong>
+ les adresses <strong>http://{#globals.webredirect.domain#}/{$smarty.session.bestalias}</strong>
+ et <strong>http://{#globals.webredirect.domain#}/{$smarty.session.forlife}</strong>
{/dynamic}
vers la page WEB de ton choix. Pour de plus amples détails, consulte
<a href="{"docs/doc_carva.php"|url}">cette page</a>
<p>
{dynamic}
{if $carva}
- Actuellement, les adresses <a href="http://www.carva.org/{$smarty.session.bestalias}">http://www.carva.org/{$smarty.session.bestalias}</a> et <a href="http://www.carva.org/{$smarty.session.forlife}">http://www.carva.org/{$smarty.session.forlife}</a>
- sont redirigées sur <a href="http://{$carva}">http://{$carva}</a>
+ Actuellement, les adresses
+ <a href="http://{#globals.webredirect.domain#}/{$smarty.session.bestalias}">
+ http://{#globals.webredirect.domain#}/{$smarty.session.bestalias}
+ </a> et <a href="http://{#globals.webredirect.domain#}/{$smarty.session.forlife}">
+ http://{#globals.webredirect.domain#}/{$smarty.session.forlife}
+ </a> sont redirigées sur <a href="http://{$carva}">http://{$carva}</a>
{else}
La redirection n'est pas utilisée ...
{/if}
+--
+-- PERMS
+--
alter table auth_user_md5 change column perms perms enum('user','admin','non-inscrit','pending','disabled');
update auth_user_md5 set perms='pending' where perms='non-inscrit';
alter table auth_user_md5 change column perms perms enum('user','admin','pending','disabled');
alter table auth_user_md5 change column comment comment varchar(64) not null;
+--
+-- be naissance live as a date
+--
+
alter table auth_user_md5 add column foo int;
update auth_user_md5 set foo=naissance ;
alter table auth_user_md5 change column naissance naissance date not null;
alter table en_cours change column naissance naissance date not null;
update en_cours set naissance = concat(foo % 10000, '-', (foo / 10000) % 100, '-', foo / 1000000);
alter table en_cours drop column foo;
+
+--
+-- webredirect
+--
+
+alter table auth_user_quick add column redirecturl varchar(255) not null;
+replace into auth_user_quick (user_id,banana_last,skin,watch_flags,watch_last,redirecturl)
+ select q.user_id,q.banana_last,q.skin,q.watch_flags,q.watch_last,u.redirecturl
+ from auth_user_md5 as u
+ inner join auth_user_quick as q USING(user_id)
+ where u.redirecturl!='';
+alter table auth_user_md5 drop column redirecturl;