git-archimport-id: opensource@polytechnique.org--2005/platal--mainline--0.9--patch-437
New :
+ * Fiche :
+ - A public fiche is now available for visiters. -Car
+
+ * Profile :
+ - One can choose precisely which fields appear on his public fiche. -Car
+
+ * Search :
+ - Public searches display more information. -Car
+
Bug/Wish :
- #270: private/public flags are now used for search. -Car
}
}
}
+ if ($user['medals_pub'] != 'public') {
+ unset($user['medals']);
+ }
}
foreach($user['adr_pro'] as $i=>$pro) {
if ($pro['entreprise'] == '' && $pro['fonction'] == ''
new_skinned_page('login.tpl', AUTH_PUBLIC);
if (Env::has('x')) {
- if (Env::get('req') == "true") {
+
+ $res = $globals->xdb->query("SELECT id, pub FROM aliases INNER JOIN photo ON(id=uid) WHERE alias = {?}", Env::get('x'));
+ list($uid, $photo_pub) = $res->fetchOneRow();
+
+ if (Env::get('req') == "true" && logged()) {
include 'validations.inc.php';
- $res = $globals->xdb->query("SELECT id FROM aliases WHERE alias = {?}", Env::get('x'));
- $myphoto = PhotoReq::get_request($a = $res->fetchOneCell());
+ $myphoto = PhotoReq::get_request($uid);
Header('Content-type: image/'.$myphoto->mimetype);
echo $myphoto->data;
} else {
$res = $globals->xdb->query(
"SELECT attachmime, attach
- FROM photo AS p
- INNER JOIN aliases AS a ON p.uid=a.id
- WHERE alias={?}", Env::get('x'));
+ FROM photo
+ WHERE uid={?}", $uid);
- if( list($type,$data) = $res->fetchOneRow() ) {
+ if( (list($type,$data) = $res->fetchOneRow()) && ($photo_pub == 'public' || logged()) ) {
Header( "Content-type: image/$type");
echo $data;
} else {
}
}
}
+
+// vim:set et sws=4 sw=4 sts=4:
?>
$page->gassign('grades');
$page->gassign('medals');
$page->gassign('trad');
+$page->assign('medals_pub', $medals_pub);
$page->assign('medal_list', $mlist);
?>
$page->assign('appli_type1',$appli_type1);
$page->assign('appli_type2',$appli_type2);
+$page->assign('photo_pub',$photo_pub);
$page->assign('nouvellephoto', $nouvellephoto);
$page->assign('nickname', $nickname);
?>
$medals = $res->fetchAllAssoc();
+$res = $globals->xdb->query("SELECT profile_medals_pub FROM auth_user_quick WHERE user_id = {?}", Session::getInt('uid', -1));
+$medals_pub = $res->fetchOneCell();
+
+if(Env::has('modifier') || Env::has('suivant')) {
+ $medals_pub = Env::has('medals_pub')?'public':'private';
+}
+// vim:set et sws=4 sw=4 sts=4:
?>
$mobile, $mobile_pub, $web, $web_pub, $freetext, $freetext_pub, $nickname,
$appli_id1,$appli_type1, $appli_id2,$appli_type2) = $result->fetchOneRow();
+$result = $globals->xdb->query("SELECT pub FROM photo WHERE uid = {?}", Session::getInt('uid', -1));
+$photo_pub = $result->fetchOneCell();
+
replace_ifset($nationalite,'nationalite');
replace_ifset($mobile,'mobile');
replace_ifset($web,"web");
$mobile_pub = Env::get('mobile_pub');
$web_pub = Env::has('web_pub')?'public':'private';
$freetext_pub = Env::has('freetext_pub')?'public':'private';
+ $photo_pub = Env::has('photo_pub')?'public':'private';
}
// Y a-t-il une photo en attente de confirmation ?
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA *
***************************************************************************/
+$globals->xdb->execute("UPDATE auth_user_quick SET profile_medals_pub = {?} WHERE user_id = {?}", $medals_pub, Session::getInt('uid', -1));
+
+// vim:set et sws=4 sw=4 sts=4:
?>
else
$globals->xdb->execute("DELETE FROM applis_ins WHERE uid= {?} AND ordre=1", Session::getInt('uid', -1));
-$globals->xdb->execute('UPDATE auth_user_quick SET profile_mobile_pub = {?}, profile_web_pub = {?}, profile_freetext_pub = {?} WHERE user_id = {?}',
- $mobile_pub, $web_pub, $freetext_pub, Session::getInt('uid', -1));
-
$sql = "UPDATE auth_user_md5
SET nationalite= {?} WHERE user_id= {?}";
$globals->xdb->execute($sql, $nationalite, Session::getInt('uid', -1));
-$globals->xdb->execute("UPDATE auth_user_quick SET profile_nick={?}, profile_mobile={?}, profile_web={?}, profile_freetext={?} WHERE user_id = {?}", $nickname, $mobile, $web, $freetext, Session::getInt('uid', -1));
+$globals->xdb->execute(
+ "UPDATE auth_user_quick SET
+ profile_nick={?},
+ profile_mobile={?}, profile_mobile_pub={?},
+ profile_web={?}, profile_web_pub={?},
+ profile_freetext={?} profile_freetext_pub={?}
+ WHERE user_id = {?}",
+ $nickname,
+ $mobile, $mobile_pub,
+ $web, $web_pub,
+ $freetext, $freetext_pub,
+ Session::getInt('uid', -1));
+$globals->xdb->execute("UPDATE photo SET pub = {?} WHERE uid = {?}", $photo_pub, Session::getInt('uid', -1));
// vim:set et sws=4 sts=4 sw=4:
?>
u.perms IN ('admin','user') AS inscrit, FIND_IN_SET('femme', u.flags) AS sexe, u.deces != 0 AS dcd, u.deces,
q.profile_nick AS nickname, q.profile_from_ax, q.profile_mobile AS mobile, q.profile_web AS web, q.profile_freetext AS freetext,
q.profile_mobile_pub AS mobile_pub, q.profile_web_pub AS web_pub, q.profile_freetext_pub AS freetext_pub,
+ q.profile_medals_pub AS medals_pub,
IF(gp.nat='',gp.pays,gp.nat) AS nationalite, gp.a2 AS iso3166,
a.alias AS forlife, a2.alias AS bestalias,
c.uid IS NOT NULL AS is_contact,
</div>
</td>
<td rowspan="4" id='photo'>
- {min_auth level="cookie"}
<img alt="Photo de {$x.forlife}" src="{$photo_url}" width="{$x.x}" height="{$x.y}" />
+ {min_auth level="cookie"}
{if $x.section}<em class="intitule">Section : </em><span>{$x.section}</span><br />{/if}
{if $x.binets_join}<em class="intitule">Binet(s) : </em><span>{$x.binets_join}</span><br />{/if}
{if $x.gpxs_join}<em class="intitule">Groupe(s) X : </em><span>{$x.gpxs_join|smarty:nodefaults}</span><br />{/if}
</td>
</tr>
{/if}
- {min_auth level="cookie"}
{if $x.medals}
<tr>
<td>
</td>
</tr>
{/if}
+ {min_auth level="cookie"}
{if $x.cv}
<tr>
<td>
<td colspan="3" class="pflags">
<table class="flags" summary="Flags" cellpadding="0" cellspacing="0">
<tr>
- <td class="rouge">
- <input type="checkbox" name="accesX" checked="checked" disabled="disabled" />
+ <td class="vert">
+ <input type="checkbox" name="medals_pub"{if $medals_pub eq 'public'} checked="checked"{/if} />
</td>
<td class="texte">
- ne peut être ni public ni transmis à l'AX
+ ces informations sont normalement publiques (JO, ...) mais tu peux choisir de les associer a ta fiche publique
</td>
</tr>
</table>
</tr>
<tr>
<td class="col" colspan="3">
+ <table class="flags" cellspacing="0" summary="Flags">
+ <tr>
+ <td class="vert">
+ <input type="checkbox" name="photo_pub" {if $photo_pub eq 'public'}checked="checked" {/if}/>
+ </td>
+ <td class="texte">
+ site public
+ </td>
+ </tr>
+ </table>
<table cellspacing="0" cellpadding="0" summary="Trombinoscope">
<tr>
<td class="dcold">
ADD profile_web VARCHAR(255) NOT NULL,
ADD profile_web_pub ENUM('private', 'public') DEFAULT 'private' NOT NULL,
ADD profile_freetext VARCHAR(255) NOT NULL,
-ADD profile_freetext_pub ENUM('private', 'public') DEFAULT 'private' NOT NULL;
+ADD profile_freetext_pub ENUM('private', 'public') DEFAULT 'private' NOT NULL,
+ADD profile_medals_pub ENUM('private', 'public') DEFAULT 'private' NOT NULL;
UPDATE auth_user_quick AS q INNER JOIN auth_user_md5 AS u USING(user_id) SET
q.profile_mobile = u.mobile,
q.profile_mobile_pub = IF(FIND_IN_SET('mobile_public', u.bits), 'public', IF(FIND_IN_SET('mobile_ax', u.bits), 'ax', 'private')),
--- /dev/null
+ALTER TABLE photo ADD pub ENUM('purivate', 'public') DEFAULT 'private' NOT NULL;