projects
/
platal.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fixes the OpenID response when there is no header to display.
[platal.git]
/
modules
/
profile
/
addresses.inc.php
diff --git
a/modules/profile/addresses.inc.php
b/modules/profile/addresses.inc.php
index
d879104
..
fa5d033
100644
(file)
--- a/
modules/profile/addresses.inc.php
+++ b/
modules/profile/addresses.inc.php
@@
-1,6
+1,6
@@
<?php
/***************************************************************************
<?php
/***************************************************************************
- * Copyright (C) 2003-200
7
Polytechnique.org *
+ * Copyright (C) 2003-200
9
Polytechnique.org *
* http://opensource.polytechnique.org/ *
* *
* This program is free software; you can redistribute it and/or modify *
* http://opensource.polytechnique.org/ *
* *
* This program is free software; you can redistribute it and/or modify *
@@
-76,15
+76,19
@@
class ProfileAddress extends ProfileGeoloc
}
}
$current = 0;
}
}
$current = 0;
+ $success = true;
foreach ($value as $key=>&$adr) {
if (@$adr['current']) {
$current++;
}
}
foreach ($value as $key=>&$adr) {
if (@$adr['current']) {
$current++;
}
}
- if (!$init && $current != 1 && count($value) > 0) {
+ if ($current == 0 && count($value) > 0) {
+ foreach ($value as $key=>&$adr) {
+ $adr['current'] = true;
+ break;
+ }
+ } else if ($current > 1) {
$success = false;
$success = false;
- } else {
- $success = true;
}
foreach ($value as $key=>&$adr) {
$ls = true;
}
foreach ($value as $key=>&$adr) {
$ls = true;
@@
-113,23
+117,22
@@
class ProfileAddress extends ProfileGeoloc
private function saveAddress($adrid, array &$address)
{
private function saveAddress($adrid, array &$address)
{
- $flags =
array
();
+ $flags =
new PlFlagSet
();
if ($address['secondaire']) {
if ($address['secondaire']) {
- $flags
[] = 'res-secondaire'
;
+ $flags
->addFlag('res-secondaire')
;
}
if ($address['mail']) {
}
if ($address['mail']) {
- $flags
[] = 'courrier'
;
+ $flags
->addFlag('courrier')
;
}
if ($address['temporary']) {
}
if ($address['temporary']) {
- $flags
[] = 'temporaire'
;
+ $flags
->addFlag('temporaire')
;
}
if ($address['current']) {
}
if ($address['current']) {
- $flags
[] = 'active'
;
+ $flags
->addFlag('active')
;
}
if ($address['checked']) {
}
if ($address['checked']) {
- $flags
[] = 'coord-checked'
;
+ $flags
->addFlag('coord-checked')
;
}
}
- $flags = implode(',', $flags);
XDB::execute("INSERT INTO adresses (adr1, adr2, adr3,
postcode, city, cityid,
country, region, regiontxt,
XDB::execute("INSERT INTO adresses (adr1, adr2, adr3,
postcode, city, cityid,
country, region, regiontxt,