function doLogin($login, $password) {
$auth = $this->authenticate($login, $password);
- if (isTrue(AUTH_DEBUG)) {
+ if (isTrue('AUTH_DEBUG')) {
echo '<br>'; var_dump($auth); echo '<br />';
}
$sql = "SELECT id FROM tt_users WHERE login = ".$mdb2->quote($login)." AND status = 1";
$res = $mdb2->query($sql);
if (is_a($res, 'PEAR_Error')) {
- if (isTrue(AUTH_DEBUG))
+ if (isTrue('AUTH_DEBUG'))
echo 'db error!<br />';
return false;
}
$val = $res->fetchRow();
if (!$val['id']) {
- if (isTrue(AUTH_DEBUG))
+ if (isTrue('AUTH_DEBUG'))
echo 'login "'.$login.'" does not exist in Time Tracker database.<br />';
return false;
}
return array('login'=>$login,'id'=>$val['id']);
} else {
// If the OLD_PASSWORDS option is defined - set it.
- if (isTrue(OLD_PASSWORDS)) {
+ if (isTrue('OLD_PASSWORDS')) {
$sql = "SET SESSION old_passwords = 1";
$res = $mdb2->query($sql);
if (is_a($res, 'PEAR_Error')) {
$lc = ldap_connect($this->params['server']);
- if (isTrue(AUTH_DEBUG)) {
+ if (isTrue('AUTH_DEBUG')) {
echo '<br />';
echo '$lc='; var_dump($lc); echo '<br />';
echo 'ldap_error()='; echo ldap_error($lc); echo '<br />';
ldap_set_option($lc, LDAP_OPT_PROTOCOL_VERSION, 3);
ldap_set_option($lc, LDAP_OPT_REFERRALS, 0);
- if (isTrue(AUTH_DEBUG)) {
+ if (isTrue('AUTH_DEBUG')) {
ldap_set_option($lc, LDAP_OPT_DEBUG_LEVEL, 7);
}
$login .= '@' . $this->params['default_domain'];
}
- if (isTrue(AUTH_DEBUG)) {
+ if (isTrue('AUTH_DEBUG')) {
echo '$login='; var_dump($login); echo '<br />';
}
$lb = @ldap_bind($lc, $login, $password);
- if (isTrue(AUTH_DEBUG)) {
+ if (isTrue('AUTH_DEBUG')) {
echo '$lb='; var_dump($lb); echo '<br />';
echo 'ldap_error()='; echo ldap_error($lc); echo '<br />';
}
$fields = array('memberof');
$sr = @ldap_search($lc, $this->params['base_dn'], $filter, $fields);
- if (isTrue(AUTH_DEBUG)) {
+ if (isTrue('AUTH_DEBUG')) {
echo '$sr='; var_dump($sr); echo '<br />';
echo 'ldap_error()='; echo ldap_error($lc); echo '<br />';
}
$entries = @ldap_get_entries($lc, $sr);
- if (isTrue(AUTH_DEBUG)) {
+ if (isTrue('AUTH_DEBUG')) {
echo '$entries='; var_dump($entries); echo '<br />';
echo 'ldap_error()='; echo ldap_error($lc); echo '<br />';
}
$groups[] = substr($grp_fields[0], 3);
}
- if (isTrue(AUTH_DEBUG)) {
+ if (isTrue('AUTH_DEBUG')) {
echo '$member_of'; var_dump($member_of); echo '<br />';
};
// Assuming OpenLDAP server.
$login_oldap = 'uid='.$login.','.$this->params['base_dn'];
- if (isTrue(AUTH_DEBUG)) {
+ if (isTrue('AUTH_DEBUG')) {
echo '$login_oldap='; var_dump($login_oldap); echo '<br />';
}
$lb = @ldap_bind($lc, $login_oldap, $password);
- if (isTrue(AUTH_DEBUG)) {
+ if (isTrue('AUTH_DEBUG')) {
echo '$lb='; var_dump($lb); echo '<br />';
echo 'ldap_error()='; echo ldap_error($lc); echo '<br />';
}
$fields = array('samaccountname', 'mail', 'memberof', 'department', 'displayname', 'telephonenumber', 'primarygroupid');
$sr = @ldap_search($lc, $this->params['base_dn'], $filter, $fields);
- if (isTrue(AUTH_DEBUG)) {
+ if (isTrue('AUTH_DEBUG')) {
echo '$sr='; var_dump($sr); echo '<br />';
echo 'ldap_error()='; echo ldap_error($lc); echo '<br />';
}
$entries = @ldap_get_entries($lc, $sr);
- if (isTrue(AUTH_DEBUG)) {
+ if (isTrue('AUTH_DEBUG')) {
echo '$entries='; var_dump($entries); echo '<br />';
echo 'ldap_error()='; echo ldap_error($lc); echo '<br />';
}
$groups[] = substr($grp_fields[0], 3);
}
- if (isTrue(AUTH_DEBUG)) {
+ if (isTrue('AUTH_DEBUG')) {
echo '$member_of'; var_dump($member_of); echo '<br />';
}
// isTrue is a helper function to return correct false for older config.php values defined as a string 'false'.
function isTrue($val)
{
- return ($val === true);
+ return (defined($val) && constant($val) === true);
}
// ttValidString is used to check user input to validate a string.
$port = defined('MAIL_SMTP_PORT') ? MAIL_SMTP_PORT : '25';
$username = defined('MAIL_SMTP_USER') ? MAIL_SMTP_USER : null;
$password = defined('MAIL_SMTP_PASSWORD') ? MAIL_SMTP_PASSWORD : null;
- $auth = isTrue(MAIL_SMTP_AUTH);
- $debug = isTrue(MAIL_SMTP_DEBUG);
+ $auth = isTrue('MAIL_SMTP_AUTH');
+ $debug = isTrue('MAIL_SMTP_DEBUG');
$mail = Mail::factory('smtp', array ('host' => $host,
'port' => $port,
break;
}
- if (isTrue(MAIL_SMTP_DEBUG))
+ if (isTrue('MAIL_SMTP_DEBUG'))
PEAR::setErrorHandling(PEAR_ERROR_PRINT);
$res = $mail->send($recipients, $headers, $data);
<br>
<table cellspacing="0" cellpadding="4" width="100%" border="0">
<tr>
- <td align="center"> Anuko Time Tracker 1.18.36.4706 | Copyright © <a href="https://www.anuko.com/lp/tt_3.htm" target="_blank">Anuko</a> |
+ <td align="center"> Anuko Time Tracker 1.18.36.4707 | Copyright © <a href="https://www.anuko.com/lp/tt_3.htm" target="_blank">Anuko</a> |
<a href="https://www.anuko.com/lp/tt_4.htm" target="_blank">{$i18n.footer.credits}</a> |
<a href="https://www.anuko.com/lp/tt_5.htm" target="_blank">{$i18n.footer.license}</a> |
<a href="https://www.anuko.com/lp/tt_7.htm" target="_blank">{$i18n.footer.improve}</a>
}
} // isPost
-if(!isTrue(MULTITEAM_MODE) && !ttOrgHelper::getOrgs())
+if(!isTrue('MULTITEAM_MODE') && !ttOrgHelper::getOrgs())
$err->add($i18n->get('error.no_groups'));
// Determine whether to show login hint. It is currently used only for Windows LDAP authentication.
}
} // isPost
-if(!isTrue(MULTITEAM_MODE) && !ttOrgHelper::getOrgs())
+if(!isTrue('MULTITEAM_MODE') && !ttOrgHelper::getOrgs())
$err->add($i18n->get('error.no_groups'));
// Determine whether to show login hint. It is currently used only for Windows LDAP authentication.
require_once('initialize.php');
import('form.Form');
-if (!isTrue(MULTITEAM_MODE) || $auth->isPasswordExternal()) {
+if (!isTrue('MULTITEAM_MODE') || $auth->isPasswordExternal()) {
header('Location: login.php');
exit();
}
print "\t<".$group_by_tag."><![CDATA[".$subtotal['name']."]]></".$group_by_tag.">\n";
if ($bean->getAttribute('chduration')) {
$val = $subtotal['time'];
- if($val && isTrue(EXPORT_DECIMAL_DURATION))
+ if($val && isTrue('EXPORT_DECIMAL_DURATION'))
$val = time_to_decimal($val);
print "\t<duration><![CDATA[".$val."]]></duration>\n";
}
if ($bean->getAttribute('chfinish')) print "\t<finish><![CDATA[".$item['finish']."]]></finish>\n";
if ($bean->getAttribute('chduration')) {
$duration = $item['duration'];
- if($duration && isTrue(EXPORT_DECIMAL_DURATION))
+ if($duration && isTrue('EXPORT_DECIMAL_DURATION'))
$duration = time_to_decimal($duration);
print "\t<duration><![CDATA[".$duration."]]></duration>\n";
}
print '"'.$subtotal['name'].'"';
if ($bean->getAttribute('chduration')) {
$val = $subtotal['time'];
- if($val && isTrue(EXPORT_DECIMAL_DURATION))
+ if($val && isTrue('EXPORT_DECIMAL_DURATION'))
$val = time_to_decimal($val);
print ',"'.$val.'"';
}
if ($bean->getAttribute('chfinish')) print ',"'.$item['finish'].'"';
if ($bean->getAttribute('chduration')) {
$val = $item['duration'];
- if($val && isTrue(EXPORT_DECIMAL_DURATION))
+ if($val && isTrue('EXPORT_DECIMAL_DURATION'))
$val = time_to_decimal($val);
print ',"'.$val.'"';
}