Skip to content

Commit

Permalink
[Jobs] adds rel="nofollow" to applications links
Browse files Browse the repository at this point in the history
  • Loading branch information
cbleek committed Sep 24, 2015
1 parent f8f9035 commit bf23f71
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 30 deletions.
51 changes: 25 additions & 26 deletions module/Auth/src/Auth/Adapter/HybridAuth.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
/** Auth adapter */
namespace Auth\Adapter;

use Doctrine\ODM\MongoDB\DocumentManager;
use Hybrid_Auth;
use Zend\Authentication\Result;
use Zend\Authentication\Adapter\AdapterInterface;
Expand Down Expand Up @@ -81,8 +80,9 @@ public function authenticate()
{

$hybridAuth = $this->getHybridAuth();
/* @var $adapter \Hybrid_Provider_Model */
$adapter = $hybridAuth->authenticate($this->_provider);

$userProfile = $adapter->getUserProfile();
$email = isset($userProfile->emailVerified) && !empty($userProfile->emailVerified)
? $userProfile->emailVerified
Expand All @@ -98,37 +98,36 @@ public function authenticate()
}


$currentInfo = $user->profile;
$currentInfo = $user->getProfile();
$newInfo = (array) $userProfile;

if ($forceSave || $currentInfo != $newInfo) {
/* */

$dm = $this->getRepository()->getDocumentManager();
if ( '' == $user->info->email) $user->info->email = $email;
$user->info->firstName = $userProfile->firstName;
$user->info->lastName = $userProfile->lastName;
$user->info->birthDay = $userProfile->birthDay;
$user->info->birthMonth = $userProfile->birthMonth;
$user->info->birthYear = $userProfile->birthYear;
$user->info->postalcode = $userProfile->zip;
$user->info->city = $userProfile->city;
$user->info->street = $userProfile->address;
$user->info->phone = $userProfile->phone;
$user->info->gender = $userProfile->gender;
if ( '' == $user->getInfo()->email) $user->getInfo()->email = $email;
$user->getInfo()->firstName = $userProfile->firstName;
$user->getInfo()->lastName = $userProfile->lastName;
$user->getInfo()->birthDay = $userProfile->birthDay;
$user->getInfo()->birthMonth = $userProfile->birthMonth;
$user->getInfo()->birthYear = $userProfile->birthYear;
$user->getInfo()->postalcode = $userProfile->zip;
$user->getInfo()->city = $userProfile->city;
$user->getInfo()->street = $userProfile->address;
$user->getInfo()->phone = $userProfile->phone;
$user->getInfo()->gender = $userProfile->gender;

$user->login = $email;

$user->setLogin($email);
$user->setProfile($newInfo);

$user->profile = $newInfo;
$dm->persist($user);
// make sure all ids are generated and user exists in database.
$dm->flush();

/*
* This must be after flush because a newly created user has no id!
*/
if ($forceSave || (!$user->info->image && $userProfile->photoURL)) {
if ($forceSave || (!$user->getInfo()->image && $userProfile->photoURL)) {
// get user image
if ('' != $userProfile->photoURL) {
$client = new \Zend\Http\Client($userProfile->photoURL, array('sslverifypeer' => false));
Expand All @@ -141,7 +140,7 @@ public function authenticate()
$userImage->setType($response->getHeaders()->get('Content-Type')->getFieldValue());
$userImage->setUser($user);
$userImage->setFile($file);
$user->info->setImage($userImage);
$user->getInfo()->setImage($userImage);
$dm->persist($userImage);
//$this->getRepository()->store($user->info);
}
Expand All @@ -152,7 +151,7 @@ public function authenticate()
}


return new Result(Result::SUCCESS, $user->id, array('firstLogin' => $forceSave, 'user' => $user));
return new Result(Result::SUCCESS, $user->getId(), array('firstLogin' => $forceSave, 'user' => $user));

}

Expand All @@ -179,12 +178,12 @@ public function setHybridAuth(Hybrid_Auth $hybridAuth)
return $this;
}


/**
* Sets the user mapper
* Sets the user repository
*
* @param UserMapperInterface $mapper
* @return HybridAuth
* @param $repository
*
* @return $this
*/
public function setRepository($repository)
{
Expand All @@ -194,9 +193,9 @@ public function setRepository($repository)
}

/**
* Gets the user mapper
* Gets the user repository
*
* @return UserMapperInterface
* @return \Auth\Repository\User
*/
public function getRepository()
{
Expand Down
2 changes: 1 addition & 1 deletion module/Jobs/public/templates/classic/index.phtml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
<div class="col-md-12">
<?php if ($this->uriApply): ?>
<h2 class="text-center">
<a target="_new" class="btn btn-lg btn-primary" href="<?php echo $this->uriApply ?>">
<a target="_new" class="btn btn-lg btn-primary" href="<?php echo $this->uriApply ?>" rel="nofollow">
<strong><?php echo $this->translate("Apply now")?></strong>
</a>
</h2>
Expand Down
2 changes: 1 addition & 1 deletion module/Jobs/public/templates/default/index.phtml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ Take a look at the <a target="_new" href="https://github.com/cross-solution/YAWI
<?php echo $this->benefits;?>

<?php if ($this->uriApply):?>
<h2><a target="_new" href="<?php echo $this->uriApply ?>"><strong>Zum Online Bewerbungsformular</strong></a></h2>
<h2><a target="_new" href="<?php echo $this->uriApply ?>" rel="nofollow"><strong>Zum Online Bewerbungsformular</strong></a></h2>
<?php endif; ?>

<address>
Expand Down
2 changes: 1 addition & 1 deletion module/Jobs/public/templates/modern/index.phtml
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
<div class="col-md-12">
<?php if ($this->uriApply): ?>
<h2 class="text-center">
<a target="_new" class="btn btn-lg btn-primary" href="<?php echo $this->uriApply ?>">
<a target="_new" class="btn btn-lg btn-primary" href="<?php echo $this->uriApply ?>" rel="nofollow">
<strong><?php echo $this->translate("Apply now")?></strong>
</a>
</h2>
Expand Down
2 changes: 1 addition & 1 deletion module/Jobs/view/jobs/index/index.ajax.phtml
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ $isRecruiter = $this->acl()->isRole( Auth\Entity\User::ROLE_RECRUITER );
$this->showPendingJobs ? $this->url('lang/jobs/approval', array(), array('query' => array('id' => $job->id)), true)
: $this->url('lang/jobs/view', array(), array('query' => array('id' => $job->id)), true)
); ?>
<a href="<?php echo $href ?>" target="_blank"><?php echo strip_tags($job->title)?></a>
<a href="<?php echo $href ?>" target="_blank" rel="nofollow"><?php echo strip_tags($job->title)?></a>

</td>
<?php if (!$this->showPendingJobs): ?>
Expand Down

0 comments on commit bf23f71

Please sign in to comment.