projects
/
platal.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Happy New Year!
[platal.git]
/
modules
/
carnet.php
diff --git
a/modules/carnet.php
b/modules/carnet.php
index
2125cf9
..
2c9f629
100644
(file)
--- a/
modules/carnet.php
+++ b/
modules/carnet.php
@@
-1,6
+1,6
@@
<?php
/***************************************************************************
<?php
/***************************************************************************
- * Copyright (C) 2003-201
0
Polytechnique.org *
+ * Copyright (C) 2003-201
1
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 *
@@
-292,9
+292,10
@@
class CarnetModule extends PLModule
case 'ajouter':
if (($contact = User::get(Env::v('user')))) {
case 'ajouter':
if (($contact = User::get(Env::v('user')))) {
- if (XDB::execute("REPLACE INTO contacts (uid, contact)
- VALUES ({?}, {?})",
- $uid, $contact->id())) {
+ XDB::execute('INSERT IGNORE INTO contacts (uid, contact)
+ VALUES ({?}, {?})',
+ $uid, $contact->id());
+ if (XDB::affectedRows() > 0) {
Platal::session()->updateNbNotifs();
$page->trigSuccess('Contact ajouté !');
} else {
Platal::session()->updateNbNotifs();
$page->trigSuccess('Contact ajouté !');
} else {
@@
-315,7
+316,7
@@
class CarnetModule extends PLModule
}
if ($search && trim(Env::v('quick'))) {
$base = 'carnet/contacts/search';
}
if ($search && trim(Env::v('quick'))) {
$base = 'carnet/contacts/search';
- $view = new
SearchSet(true, false,
new UFC_Contact($user));
+ $view = new
QuickSearchSet(
new UFC_Contact($user));
} else {
$base = 'carnet/contacts';
$view = new ProfileSet(new UFC_Contact($user));
} else {
$base = 'carnet/contacts';
$view = new ProfileSet(new UFC_Contact($user));
@@
-382,7
+383,7
@@
class CarnetModule extends PLModule
$user = Platal::session()->tokenAuth($alias, $hash);
if (is_null($user)) {
if (S::logged()) {
$user = Platal::session()->tokenAuth($alias, $hash);
if (is_null($user)) {
if (S::logged()) {
- $user =
=
S::user();
+ $user = S::user();
} else {
return PL_FORBIDDEN;
}
} else {
return PL_FORBIDDEN;
}
@@
-415,7
+416,7
@@
class CarnetModule extends PLModule
$user = Platal::session()->tokenAuth($alias, $hash);
if (is_null($user)) {
if (S::logged()) {
$user = Platal::session()->tokenAuth($alias, $hash);
if (is_null($user)) {
if (S::logged()) {
- $user =
=
S::user();
+ $user = S::user();
} else {
return PL_FORBIDDEN;
}
} else {
return PL_FORBIDDEN;
}
@@
-445,7
+446,7
@@
class CarnetModule extends PLModule
$user = Platal::session()->tokenAuth($alias, $hash);
if (is_null($user)) {
if (S::logged()) {
$user = Platal::session()->tokenAuth($alias, $hash);
if (is_null($user)) {
if (S::logged()) {
- $user =
=
S::user();
+ $user = S::user();
} else {
return PL_FORBIDDEN;
}
} else {
return PL_FORBIDDEN;
}