Exemplo n.º 1
0

<?php 
require_once $_SERVER['DOCUMENT_ROOT'] . "/database.class.php";
$manager = new DatabaseManager();
if ($_SERVER['REQUEST_METHOD'] === 'POST') {
    // They have submitted changes to the keychain
    foreach ($_POST as $key => $value) {
        if (!empty($key) && !empty($value)) {
            $manager->settingsSetValueForKey($key, $value);
        }
    }
    echo "Changes Saved!";
}
// They are requesting to see the editor webpage
$foursquareToken = $manager->settingsValueForKey("foursquare_token");
$instagramId = $manager->settingsValueForKey("instagram_id");
$instagramSecret = $manager->settingsValueForKey("instagram_secret");
$instagramUrl = $manager->settingsValueForKey("instagram_url");
$instagramUri = $manager->settingsValueForKey("instagram_uri");
$password = $manager->settingsValueForKey("password");
$printing = $manager->settingsValueForKey("printing");
$checked = $printing == 1 ? "checked='checked'" : "";
echo "<input name='foursquare_token' type='text' placeholder='Foursquare Token' value='{$foursquareToken}'>";
echo "<input name='instagram_id' type='text' placeholder='Instagram Client Id' value='{$instagramId}'>";
echo "<input name='instagram_secret' type='text' placeholder='Instagram Client Secret' value='{$instagramSecret}'>";
echo "<input name='instagram_url' type='text' placeholder='Instagram Callback Url' value='{$instagramUrl}'>";
echo "<input name='instagram_uri' type='text' placeholder='Instagram Oauth Callback' value='{$instagramUri}'>";
echo "<input name='password' type='text' placeholder='Password' value='{$password}'>";
echo "<input name='printing' type='checkbox' {$checked}>";
?>
Exemplo n.º 2
0
 public function getInstagramRedirectUri()
 {
     $manager = new DatabaseManager();
     $credentials = $this->getInstagramCredentials();
     return $manager->settingsValueForKey("instagram_uri");
 }