]> git.immae.eu Git - github/wallabag/wallabag.git/blobdiff - inc/poche/Poche.class.php
from spaces to commas
[github/wallabag/wallabag.git] / inc / poche / Poche.class.php
index 6a742019fbbd03d111685a1dce13acdc07e1eb7d..81a18c8603b95af167876c943a02d6523c89d001 100755 (executable)
@@ -199,6 +199,7 @@ class Poche
                 } else {
                   Tools::redirect('?view=home&closewin=true');
                 }
+                return $last_id;
                 break;
             case 'delete':
                 if (isset($_GET['search'])) {
@@ -576,6 +577,8 @@ class Poche
                 Tools::redirect($referer);
             }
             $this->messages->add('e', _('login failed: bad login or password'));
+            // log login failure in web server log to allow fail2ban usage
+            error_log('user '.$login.' authentication failure');
             Tools::logm('login failed');
             Tools::redirect();
         }
@@ -661,7 +664,18 @@ class Poche
                         $urlsInserted[] = $url; //add
                         if (isset($record['tags']) && trim($record['tags'])) {
 
-                            // @TODO: set tags
+                            $tags = explode(',', $record['tags']);                                                                                                             
+                                                       foreach($tags as $tag) {
+                                                               $entry_id = $id;
+                                                               $tag_id = $this->store->retrieveTagByValue($tag);
+                                                               if ($tag_id) {
+                                                                       $this->store->setTagToEntry($tag_id['id'], $entry_id);                                                                  
+                                                               } else {
+                                                                       $this->store->createTag($tag);
+                                                                       $tag_id = $this->store->retrieveTagByValue($tag);
+                                                                       $this->store->setTagToEntry($tag_id['id'], $entry_id);
+                                                               }
+                                                       }
 
                         }
                     }