Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 30 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -36,3 +36,33 @@ run-tests.log
/config/*.local.php
/config/*-*.php


# Added by horde-components QC --fix-qc-issues
# Build artifacts directory
/build/
# Composer dependencies directory
/vendor/
# Composer lock file (libraries should not commit lock files)
/composer.lock
# PHPStorm IDE settings
/.idea/
# VSCode IDE settings
/.vscode/
# Claude Code CLI cache and state
/.claude/
# Cline extension data
/.cline/
# PHP CS Fixer cache file
/.php-cs-fixer.cache
# PHPUnit result cache
/.phpunit.result.cache
# PHPUnit Cache (other)
/.phpunit.cache
# PHPStan local configuration
/phpstan.neon
# PHPStan cache directory
/.phpstan.cache/
# Horde installer plugin runtime data
/var/
# Horde installer plugin web-accessible directory
/web/
4 changes: 4 additions & 0 deletions .horde.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,3 +39,7 @@ autoload:
psr-4:
Horde\Folks\: src/
vendor: horde
keywords: []
quality:
phpstan:
level: 9
11 changes: 7 additions & 4 deletions account/approve.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
<?php

use Horde\Util\Util;

/**
* Copyright 2007 Obala d.o.o. (http://www.obala.si/)
* Copyright 2007-2026 Obala d.o.o. (http://www.obala.si/)
*
* See the enclosed file LICENSE for license information (LGPL). If you
* did not receive this file, see http://www.horde.org/licenses/lgpl21.
Expand All @@ -13,14 +16,14 @@
$title = _("Confirm email");

// Get supplied code
$code = Horde_Util::getGet('code');
$code = Util::getGet('code');
if (empty($code)) {
$notification->push(_("You must supply a confirmation code."));
throw new Horde_Registry_AuthenticationFailure();
}

// Get supplied username
$user = Horde_Util::getGet('user');
$user = Util::getGet('user');
if (empty($code)) {
$notification->push(_("You must supply a username."));
throw new Horde_Registry_AuthenticationFailure();
Expand Down Expand Up @@ -48,7 +51,7 @@

// Check code
if ($internal_code == $code) {
$update = $folks_driver->saveProfile(array('user_status' => 'active'), $user);
$update = $folks_driver->saveProfile(['user_status' => 'active'], $user);
if ($update instanceof PEAR_Error) {
$notification->push($update);
} else {
Expand Down
11 changes: 7 additions & 4 deletions account/renew.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
<?php

use Horde\Util\Util;

/**
* Copyright 2007 Obala d.o.o. (http://www.obala.si/)
* Copyright 2007-2026 Obala d.o.o. (http://www.obala.si/)
*
* See the enclosed file LICENSE for license information (LGPL). If you
* did not receive this file, see http://www.horde.org/licenses/lgpl21.
Expand All @@ -13,14 +16,14 @@
$title = _("Renew account");

// Get supplied code
$code = Horde_Util::getGet('code');
$code = Util::getGet('code');
if (empty($code)) {
$notification->push(_("You must supply a confirmation code."));
throw new Horde_Exception_AuthenticationFailure();
}

// Get supplied username
$user = Horde_Util::getGet('user');
$user = Util::getGet('user');
if (empty($code)) {
$notification->push(_("You must supply a username."));
throw new Horde_Exception_AuthenticationFailure();
Expand Down Expand Up @@ -48,7 +51,7 @@

// Check code
if ($internal_code == $code) {
$update = $folks_driver->saveProfile(array('user_status' => 'active', $user));
$update = $folks_driver->saveProfile(['user_status' => 'active', $user]);
if ($update instanceof PEAR_Error) {
$notification->push($update);
} else {
Expand Down
48 changes: 30 additions & 18 deletions account/resetpassword.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
<?php

use Horde\Util\Util;

/**
* Copyright 2007 Obala d.o.o. (http://www.obala.si/)
* Copyright 2007-2026 Obala d.o.o. (http://www.obala.si/)
*
* See the enclosed file LICENSE for license information (LGPL). If you
* did not receive this file, see http://www.horde.org/licenses/lgpl21.
Expand Down Expand Up @@ -29,12 +32,12 @@
$form->setButtons(_("Continue"));

// Get user security pass
$user = Horde_Util::getFormData('username');
$user = Util::getFormData('username');
if ($user) {
$u_prefs = $injector->getInstance('Horde_Prefs')->getPrefs('horde', array(
$u_prefs = $injector->getInstance('Horde_Prefs')->getPrefs('horde', [
'cache' => false,
'user' => $registry->convertUsername($user, true)
));
'user' => $registry->convertUsername($user, true),
]);
$answer = $u_prefs->getValue('security_answer');
$question = $u_prefs->getValue('security_question');
} else {
Expand All @@ -52,8 +55,15 @@
$form->addVariable(_("Security answer"), 'security_answer', 'text', true);
} else {
$desc = _("The picture above is for antispam checking. Please retype the characters from the picture. They are case sensitive.");
$form->addVariable(_("Human check"), 'captcha', 'captcha', true, false, $desc,
array(Folks::getCAPTCHA(!$form->isSubmitted()), HORDE_BASE . '/config/couri.ttf'));
$form->addVariable(
_("Human check"),
'captcha',
'captcha',
true,
false,
$desc,
[Folks::getCAPTCHA(!$form->isSubmitted()), HORDE_BASE . '/config/couri.ttf']
);
}

/* Validate the form. */
Expand All @@ -68,21 +78,23 @@
}

/* Check the given values with the prefs stored ones. */
if ((!empty($answer) && Horde_String::lower($answer) == Horde_String::lower($info['security_answer'])) ||
empty($answer)) {
if ((!empty($answer) && Horde_String::lower($answer) == Horde_String::lower($info['security_answer']))
|| empty($answer)) {

/* Info matches, so reset the password. */
$password = $auth->resetPassword($info['username']);
if ($password instanceof PEAR_Error) {
$notification->push($password);
throw new Horde_Exception_AuthenticationFailure();
throw new Horde_Exception_AuthenticationFailure();
}

$body = sprintf(_("Your new password for %s is: %s. \n\n It was requested by %s on %s"),
$registry->get('name', 'horde'),
$password,
$_SERVER['REMOTE_ADDR'],
date('Ymd H:i:s'));
$body = sprintf(
_("Your new password for %s is: %s. \n\n It was requested by %s on %s"),
$registry->get('name', 'horde'),
$password,
$_SERVER['REMOTE_ADDR'],
date('Ymd H:i:s')
);

Folks::sendMail($email, _("Your password has been reset"), $body);

Expand All @@ -95,9 +107,9 @@
}
}

$page_output->header(array(
'title' => $title
));
$page_output->header([
'title' => $title,
]);
require FOLKS_TEMPLATES . '/menu.inc';
require FOLKS_TEMPLATES . '/login/signup.php';
$page_output->footer();
13 changes: 7 additions & 6 deletions account/signup.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<?php

/**
* Copyright 2007 Obala d.o.o. (http://www.obala.si/)
* Copyright 2007-2026 Obala d.o.o. (http://www.obala.si/)
*
* See the enclosed file LICENSE for license information (LGPL). If you
* did not receive this file, see http://www.horde.org/licenses/lgpl21.
Expand All @@ -13,8 +14,8 @@
$auth = $injector->getInstance('Horde_Core_Factory_Auth')->create();

// Make sure signups are enabled before proceeding
if ($conf['signup']['allow'] !== true ||
!$auth->hasCapability('add')) {
if ($conf['signup']['allow'] !== true
|| !$auth->hasCapability('add')) {
$notification->push(_("User Registration has been disabled for this site."), 'horde.error');
throw new Horde_Exception_AuthenticationFailure();
}
Expand Down Expand Up @@ -47,9 +48,9 @@
}
}

$page_output->header(array(
'title' => _("Sign up")
));
$page_output->header([
'title' => _("Sign up"),
]);
require FOLKS_TEMPLATES . '/menu.inc';
require FOLKS_TEMPLATES . '/login/signup.php';
$page_output->footer();
3 changes: 2 additions & 1 deletion account/tabs.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<?php

/**
* Copyright 2007 Obala d.o.o. (http://www.obala.si/)
* Copyright 2007-2026 Obala d.o.o. (http://www.obala.si/)
*
* See the enclosed file LICENSE for license information (LGPL). If you
* did not receive this file, see http://www.horde.org/licenses/lgpl21.
Expand Down
25 changes: 14 additions & 11 deletions account/username.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<?php

/**
* Copyright 2007 Obala d.o.o. (http://www.obala.si/)
* Copyright 2007-2026 Obala d.o.o. (http://www.obala.si/)
*
* See the enclosed file LICENSE for license information (LGPL). If you
* did not receive this file, see http://www.horde.org/licenses/lgpl21.
Expand All @@ -21,20 +22,22 @@
if ($form->validate()) {
$info = $form->getInfo();

$users = $folks_driver->getUsers(array('email' => $info['email']));
$users = $folks_driver->getUsers(['email' => $info['email']]);
if ($users instanceof PEAR_Error) {
$notification->push($users);
} elseif (empty($users) || count($users) != 1) {
$notification->push(_("Could not find any username with this email."), 'horde.warning');
} else {
$users = current($users);

$body = sprintf(_("Your username on %s %s is: %s. \n\n It was requested by %s on %s"),
$registry->get('name', 'horde'),
Horde::url($registry->get('webroot', 'horde'), true),
$users['user_uid'],
$_SERVER['REMOTE_ADDR'],
date('Ymd H:i:s'));
$body = sprintf(
_("Your username on %s %s is: %s. \n\n It was requested by %s on %s"),
$registry->get('name', 'horde'),
Horde::url($registry->get('webroot', 'horde'), true),
$users['user_uid'],
$_SERVER['REMOTE_ADDR'],
date('Ymd H:i:s')
);

Folks::sendMail($info['email'], _("Your username was requested"), $body);

Expand All @@ -44,9 +47,9 @@
}
}

$page_output->header(array(
'title' => $title
));
$page_output->header([
'title' => $title,
]);
require FOLKS_TEMPLATES . '/menu.inc';
require FOLKS_TEMPLATES . '/login/signup.php';
$page_output->footer();
28 changes: 17 additions & 11 deletions activity.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
<?php

use Horde\Util\Util;

/**
* Copyright Obala d.o.o. (www.obala.si)
*
Expand All @@ -19,28 +22,31 @@
$count = 0;
}

$page = Horde_Util::getGet('page', 0);
$page = Util::getGet('page', 0);
$perpage = $prefs->getValue('per_page');
$criteria = array('sort_by' => 'activity', 'sort_dir' => 0);
$criteria = ['sort_by' => 'activity', 'sort_dir' => 0];
$users = $folks_driver->getUsers($criteria, $page * $perpage, $perpage);
if ($users instanceof PEAR_Error) {
$notification->push($users);
$users = array();
$users = [];
}

$vars = Horde_Variables::getDefaultVariables();
$pager = new Horde_Core_Ui_Pager('page',
$vars, array('num' => $count,
'url' => 'activity.php',
'perpage' => $perpage));
$pager = new Horde_Core_Ui_Pager(
'page',
$vars,
['num' => $count,
'url' => 'activity.php',
'perpage' => $perpage]
);

$pager->preserve($criteria);
$list_url = Folks::getUrlFor('list', 'activity');

$page_output->addScriptFile('stripe.js', 'horde');
$page_output->header(array(
'title' => $title
));
$notification->notify(array('listeners' => 'status'));
$page_output->header([
'title' => $title,
]);
$notification->notify(['listeners' => 'status']);
require FOLKS_TEMPLATES . '/list/list.php';
$page_output->footer();
Loading