diff --git a/README.md b/README.md index 3c9f74f8e2..99d1b6e858 100644 --- a/README.md +++ b/README.md @@ -1,10 +1,33 @@ -Phraseanet - Digital Asset Management application +Phraseanet 3.5 - Digital Asset Management application ================================================= -#Installation +#Features : -**Nginx** +Metadatas Management (include Thesaurus and DublinCore Mapping) +Search Engine (Sphinx Search Integration) +RestFull APIS (See Developer Documentation http://docs.phraseanet.com/Devel) +Bridge to Youtube/Dailymotion/Flickr +#Documentation : + +http://docs.phraseanet.com + +#Easy Installation + +**Fetch Sources** + +
+ +git clone git://github.com/alchemy-fr/Phraseanet.git Phraseanet +cd Phraseanet +./vendors.php + ++ + +**Setup your webserver** + +***Nginx***
server { listen 80; @@ -15,58 +38,21 @@ server { location /web { - alias /home/grosroro/workspace/Phraseanet-Trunk/datas/web; + alias /path/to/Phraseanet/datas/web; } location /download { internal; - alias /home/grosroro/workspace/Phraseanet-Trunk/tmp/download; + alias /path/to/Phraseanet/tmp/download; } location /lazaret { internal; - alias /home/grosroro/workspace/Phraseanet-Trunk/tmp/lazaret; + alias /path/to/Phraseanet/tmp/lazaret; } }-#Pimp my install -**xsendfile** -
- location /protected { - internal; - alias /home/grosroro/workspace/Phraseanet-Trunk/datas/noweb/; - } -- -**MP4 pseudo stream** -
- location /mp4_video { - internal; - mp4; - alias /home/grosroro/workspace/Phraseanet-Trunk/datas/noweb/; - } - - location /mp4_videos { - secure_download on; - secure_download_secret S3cre3t; - secure_download_path_mode file; - - if ($secure_download = "-1") { - return 403; - } - if ($secure_download = "-2") { - return 403; - } - if ($secure_download = "-3") { - return 500; - } - rewrite ^/mp4_videos(.*)/[0-9a-zA-Z]*/[0-9a-zA-Z]*$ /mp4_video$1 last; - } -- -#RESTFULL APIs - -See the [online developer reference] [1] +Let's go ! #License diff --git a/config/stamp/.gitignore b/config/stamp/.gitignore new file mode 100644 index 0000000000..d6b7ef32c8 --- /dev/null +++ b/config/stamp/.gitignore @@ -0,0 +1,2 @@ +* +!.gitignore diff --git a/config/topics/.gitignore b/config/topics/.gitignore new file mode 100644 index 0000000000..d6b7ef32c8 --- /dev/null +++ b/config/topics/.gitignore @@ -0,0 +1,2 @@ +* +!.gitignore diff --git a/config/wm/.gitignore b/config/wm/.gitignore new file mode 100644 index 0000000000..d6b7ef32c8 --- /dev/null +++ b/config/wm/.gitignore @@ -0,0 +1,2 @@ +* +!.gitignore diff --git a/lib/classes/Feed/Entry/Adapter.class.php b/lib/classes/Feed/Entry/Adapter.class.php index 58776f3f3e..ef7c035543 100644 --- a/lib/classes/Feed/Entry/Adapter.class.php +++ b/lib/classes/Feed/Entry/Adapter.class.php @@ -357,6 +357,16 @@ class Feed_Entry_Adapter implements Feed_Entry_Interface, cache_cacheableInterfa return $this->publisher; } + + /** + * + * @param User_adapter $user + * @return boolean + */ + public function is_publisher(User_adapter $user) + { + return $user->get_id() === $this->get_publisher()->get_user()->get_id(); + } /** * diff --git a/lib/classes/Session/Handler.class.php b/lib/classes/Session/Handler.class.php index 100d09abb4..2834457b1e 100644 --- a/lib/classes/Session/Handler.class.php +++ b/lib/classes/Session/Handler.class.php @@ -576,7 +576,7 @@ class Session_Handler $sql = 'SELECT v.id as validate_id, v.usr_id, v.ssel_id , s.usr_id as owner, t.value FROM (validate v, ssel s) - LEFT JOIN tokens t + INNER JOIN tokens t ON (t.datas = s.ssel_id AND v.usr_id=t.usr_id AND t.type="validate") WHERE expires_on < :expires_on @@ -594,7 +594,8 @@ class Session_Handler 'ssel_id' => $row['ssel_id'], 'from' => $row['owner'], 'validate_id' => $row['validate_id'], - 'url' => $registry->get('GV_ServerName') . 'lightbox/validate/'.$row['ssel_id'].'/?LOG=' . $row['value'] + 'url' => $registry->get('GV_ServerName') + . 'lightbox/validate/'.$row['ssel_id'].'/?LOG=' . $row['value'] ); $events_mngr->trigger('__VALIDATION_REMINDER__', $params); diff --git a/lib/classes/User/Adapter.class.php b/lib/classes/User/Adapter.class.php index 3cb03cda7e..98a374e720 100644 --- a/lib/classes/User/Adapter.class.php +++ b/lib/classes/User/Adapter.class.php @@ -399,7 +399,14 @@ class User_Adapter implements User_Interface, cache_cacheableInterface { if (!trim($email)) $email = null; + + $test_user = User_Adapter::get_usr_id_from_email($email); + if($test_user && $test_user != $this->get_id()) + { + throw new Exception_InvalidArgument (sprintf(_('A user already exists with email addres %s'), $email)); + } + $sql = 'UPDATE usr SET usr_mail = :new_email WHERE usr_id = :usr_id'; $stmt = $this->appbox->get_connection()->prepare($sql); $stmt->execute(array(':new_email' => $email, ':usr_id' => $this->get_id())); @@ -1231,6 +1238,7 @@ class User_Adapter implements User_Interface, cache_cacheableInterface protected function load_preferences() { if ($this->_prefs) + return $this; $sql = 'SELECT prop, value FROM usr_settings WHERE usr_id= :id'; $stmt = $this->appbox->get_connection()->prepare($sql); @@ -1324,7 +1332,7 @@ class User_Adapter implements User_Interface, cache_cacheableInterface } catch (Exception $e) { - + } return $this; @@ -1556,6 +1564,7 @@ class User_Adapter implements User_Interface, cache_cacheableInterface $appbox = appbox::get_instance(); $session = $appbox->get_session(); if (!$session->is_authenticated()) + return; $ses_id = $session->get_ses_id(); @@ -1614,7 +1623,7 @@ class User_Adapter implements User_Interface, cache_cacheableInterface } catch (Exception $e) { - + } } } @@ -1678,7 +1687,7 @@ class User_Adapter implements User_Interface, cache_cacheableInterface } catch (Exception $e) { - + } return false; @@ -1765,7 +1774,7 @@ class User_Adapter implements User_Interface, cache_cacheableInterface } catch (Exception $e) { - + } return $locale; @@ -1831,6 +1840,7 @@ class User_Adapter implements User_Interface, cache_cacheableInterface public function get_nonce() { if ($this->nonce) + return $this->nonce; $nonce = false; @@ -1848,6 +1858,7 @@ class User_Adapter implements User_Interface, cache_cacheableInterface return $this->nonce; } + public function __sleep() { $vars = array(); diff --git a/lib/classes/mail.class.php b/lib/classes/mail.class.php index 59bd8d00c0..ab04900fad 100644 --- a/lib/classes/mail.class.php +++ b/lib/classes/mail.class.php @@ -255,8 +255,7 @@ class mail $mail->ConfirmReadingTo = $reading_confirm_to; } - $mail->MsgHTML(strip_tags($body)); -// $mail->MsgHTML(p4string::cleanTags($body)); + $mail->MsgHTML(strip_tags($body, '