コード例 #1
0
function do_generate_token()
{
    $person_id = get_http_var("person_id");
    $login_dest = get_http_var("login_dest");
    $person = db_getRow("SELECT * FROM person WHERE id=?", get_http_var('person_id'));
    $template_data = array();
    $url = person_make_signon_url(rabx_serialise($template_data), $person['email'], "GET", $login_dest, null);
    db_commit();
    ?>
<p>Here is your login link:</p>
<p><a href="<?php 
    echo $url;
    ?>
"><?php 
    echo $url;
    ?>
</a></p>
<p>(This will log in as <code><?php 
    echo $person['email'];
    ?>
</code> and go the <code><?php 
    echo $login_dest;
    ?>
</code> page)</p>
<?php 
}
コード例 #2
0
ファイル: claims.php プロジェクト: bcampbell/journalisted
function do_ComposeWelcomeEmail()
{
    $person_id = get_http_var('person_id');
    $journo_id = get_http_var('journo_id');
    $emailtext = get_http_var('emailtext');
    $subject = get_http_var('subject', "Your journalisted profile");
    $journo = db_getRow("SELECT * FROM journo WHERE id=?", $journo_id);
    $person = db_getRow("SELECT * FROM person WHERE id=?", $person_id);
    if (!$emailtext) {
        /* suggested email text */
        $firstname = ucwords($journo['firstname']);
        //$profile_url = OPTION_BASE_URL . "/" . $journo['ref'] . "?login=1";
        // generate a link that'll log them in and take them to their profile
        $template_data = array();
        $login_link = person_make_signon_url(rabx_serialise($template_data), $person['email'], "GET", '/' . $journo['ref'], null);
        db_commit();
        $emailtext = <<<EOT
Hi {$firstname},
Your account at journalisted has been activated, and you can now edit your profile page at:

{$login_link}

You can also contact us via Twitter @journalisted

Best wishes
The journalisted team
EOT;
    }
    ?>
    <h3>Send a welcome email to <?php 
    echo h($person['email']);
    ?>
</h3>
    <p>Let them know their account has been approved...</p>
    <form method="POST" action="/adm/claims">
    <input type="hidden" name="person_id" value="<?php 
    echo h($person_id);
    ?>
" />
    <input type="hidden" name="journo_id" value="<?php 
    echo h($journo_id);
    ?>
" />
    <label for="subject">subject:</label><br/>
    <input type="text" id="subject" name="subject" value="<?php 
    echo h($subject);
    ?>
" />
    <br/>
    <label for="emailtext">message:</label><br/>
    <textarea id="emailtext" name="emailtext" cols="80" rows="15">
<?php 
    echo h($emailtext);
    ?>
    </textarea>
    <input type="hidden" name="action" value="send_welcome_email" />
    <br/>
    <button type="submit">Send This Email</button>
    </form>
<?php 
}