Skip to content

Commit

Permalink
Merge pull request #682 from Leantime/fixes
Browse files Browse the repository at this point in the history
Fixes
  • Loading branch information
marcelfolaron committed Apr 16, 2022
2 parents 254094b + f74cb3d commit 34cd54a
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 11 deletions.
4 changes: 2 additions & 2 deletions src/core/class.login.php
Expand Up @@ -275,7 +275,7 @@ private function login()
////C: update users from the identity provider

//Try Ldap
if($this->config->useLdap === true){
if($this->config->useLdap === true && extension_loaded('ldap')){

$ldap = new ldap();

Expand Down Expand Up @@ -642,7 +642,7 @@ private function getUser($username)

}

private function generateLinkAndSendEmail($username)
public function generateLinkAndSendEmail($username)
{

$permitted_chars = '0123456789abcdefghijklmnopqrstuvwxyz';
Expand Down
15 changes: 11 additions & 4 deletions src/core/class.mailer.php
Expand Up @@ -66,9 +66,9 @@ public function __construct()
$this->from = $config->email;

//PHPMailer
$this->mailAgent = new PHPMailer();
$this->mailAgent = new PHPMailer(true);

$this->mailAgent->CharSet = 'UTF-8'; //Ensure UTF-8 is used for emails
$this->mailAgent->CharSet = 'UTF-8'; //Ensure UTF-8 is used for emails

//Use SMTP or php mail().
if($config->useSMTP === true) {
Expand Down Expand Up @@ -214,8 +214,15 @@ public function sendMail(array $to, $from)
$to = array_unique($to);

foreach ($to as $recip) {
$this->mailAgent->addAddress($recip);
$this->mailAgent->send();

try {
$this->mailAgent->addAddress($recip);
$this->mailAgent->send();
}catch(Exception $e){
error_log($this->mailAgent->ErrorInfo);
error_log($e->getMessage());
}

$this->mailAgent->clearAllRecipients();
}

Expand Down
Expand Up @@ -130,7 +130,7 @@ class="fa fa-money-bill-alt"></span><?php echo $this->__('label.budgets'); ?></h
</h4>
</div>

<div class="row-fluid padding-top">
<div class="row-fluid padding-top" style="display:none;">
<div class="span8">
<div class="form-group">

Expand Down
5 changes: 5 additions & 0 deletions src/domain/tickets/controllers/class.editMilestone.php
Expand Up @@ -61,6 +61,11 @@ public function get($params)
$this->tpl->redirect(BASE_URL."/tickets/roadmap/");
}

//Ensure this ticket belongs to the current project
if($_SESSION["currentProject"] != $milestone->projectId) {
$this->projectService->changeCurrentSessionProject($milestone->projectId);
}

$comments = $this->commentsService->getComments('ticket', $params['id']);

}else{
Expand Down
4 changes: 0 additions & 4 deletions src/domain/users/controllers/class.newUser.php
Expand Up @@ -55,10 +55,6 @@ public function run()
$values['clientId'] = core\login::getUserClientId();
}

//Validation
//print_r($_POST);
# exit();

if ($values['user'] !== '') {
if ($_POST['password'] == $_POST['password2']) {
if (filter_var($values['user'], FILTER_VALIDATE_EMAIL)) {
Expand Down

0 comments on commit 34cd54a

Please sign in to comment.