Ejemplo n.º 1
0
function generate_token()
{
    //$format = '(%1$2d = %1$04b) = (%2$2d = %2$04b)' . ' %3$s (%4$2d = %4$04b)' . "\n";
    $t = time();
    $mask = 0xfffff00;
    $priv_key = get_private_key();
    $token = $t & $mask ^ $priv_key;
    return $token;
}
Ejemplo n.º 2
0
/**
 * Validate a submitted recaptcha
 * 
 * @return boolean
 */
function validate_recaptcha()
{
    require_once dirname(__DIR__) . '/vendor/autoload.php';
    $privatekey = get_private_key();
    $recaptcha = new \ReCaptcha\ReCaptcha($privatekey);
    $resp = $recaptcha->verify(get_input('g-recaptcha-response'), get_ip());
    return $resp->isSuccess();
}
Ejemplo n.º 3
0
$text = str_replace("www.oktick.com", "www." . MAILHOST, $text);
$text = str_replace("https", "http", $text);
$setPriority = $n['setPriority'];
// 3 - normal
$setId = str_replace("oktick.com", MAILHOST, $n['setId']);
// $subscriber->id .'.'. $campaign->id .'.'. time() . "@aruba1.generated"
if (DEBUG) {
    $setSubject = $setSubject . "-" . date("c");
    $setTo = "leancode+" . time() . "@gmail.com";
    echo $setSubject . "<br>";
    //	$setReturnPath = "*****@*****.**";
    //	$setFrom = $setReplyTo = $setSender = array('*****@*****.**' => 'OKTicK Search Ltd');
    //	foreach ( $setFrom as $fromAddress => $fromName);
}
// initialise the dkim
$privateKey = get_private_key();
// Generated one as the paired public key is set in DNS
$selector = 'default';
//$signer = Swift_Signers_DKIMSigner::newInstance($privateKey, $domain, $selector)
$signer = new Swift_Signers_DKIMSigner($privateKey, MAILHOST, $selector);
$signer->setBodyCanon('relaxed')->ignoreHeader('Return-Path')->setHeaderCanon('relaxed')->setHashAlgorithm('rsa-sha1');
// make sure we are on the right domain for the links in the message
$log = new Logging();
$log->lfile('/home/oktick-beta/email.log');
// set path and name of log file (optional)
/*
$log->lwrite("setReturnPath($setReturnPath)");
$log->lwrite("setSubject($setSubject)");
$log->lwrite("setFrom($fromAddress, $fromName)");
$log->lwrite("setTo($setTo)");
//$log->lwrite("setBody($html)");
     break;
 case "get_public_ssh_key_form":
     printHeader('Get Public SSH Key');
     get_public_ssh_key_form();
     printFooter();
     break;
 case "get_public_ssh_key":
     get_public_ssh_key($_POST['key_name'], $_POST['pass']);
     break;
 case "get_mod_private_form":
     printHeader('Get Private Key');
     get_mod_private_form();
     printFooter();
     break;
 case "get_mod_private":
     get_private_key($_POST['key_name'], $_POST['pass'], $_POST['strip_passphrase'], $_POST['puttygen'], $_POST['rename_ext']);
     break;
 case "view_csr_details_form":
     printHeader('View CSR Details');
     view_csr_details_form();
     printFooter();
     break;
 case "view_csr_details":
     printHeader('View CSR Details');
     view_csr($_POST['csr_name']);
     printFooter();
     break;
 case "check_key_passphrase_form":
     printHeader('Check CA Passphrase');
     check_key_passphrase_form();
     printFooter();