Permalink
Browse files

Now you get a default photo when the photo is not found.

  • Loading branch information...
1 parent d81176c commit a8871fae827236d8c98292304352e5c95325bc12 @db0company committed Apr 5, 2012
Showing with 5 additions and 4 deletions.
  1. +5 −4 ionisinfo.class.php
View
@@ -324,16 +324,17 @@ public function getReportUrl($login)
public function getPhotoUrl($login)
{
+ $default = 'http://www.epitech.eu/intra/photos/no.jpg';
$school = $this->getSchool($login);
if (empty($school))
- return ('');
+ return ($default);
if ($school == 'epita')
$photo = 'https://www.acu.epita.fr/intra/photo/'.$login;
else
$photo = 'http://www.epitech.eu/intra/photos/'.$login.'.jpg';
if (@fopen($photo, 'r'))
return ($photo);
- return ('');
+ return ($default);
}
public function copyPhoto($login, $directory = '.')
@@ -357,11 +358,11 @@ public function getPlan($login, $directory = '.')
{
if (!$this->afs)
{
- if (!($connection = $this->sshConnect())
+ if (!($connection = @$this->sshConnect())
|| (!(@ssh2_scp_recv($connection, '/u/all/'.$login.'/public/.plan', $path))))
return ('');
}
- elseif (!copy('/afs/epitech.net/users/all/'.$login.'/public/.plan', $path))
+ elseif (!@copy('/afs/epitech.net/users/all/'.$login.'/public/.plan', $path))
return ('');
}
$filehand = @file($path);

0 comments on commit a8871fa

Please sign in to comment.