static function upgrade($version)
 {
     log::info("aws_s3", "Commencing module upgrade (" . $version . ")");
     switch ($version) {
         case 0:
             log::info("aws_s3", "Installing version 1");
             @mkdir(VARPATH . "modules/aws_s3");
             @mkdir(VARPATH . "modules/aws_s3/log");
             // installation's unique identifier - allows multiple g3's pointing to the same s3 bucket.
             if (!module::get_var("aws_s3", "g3id")) {
                 module::set_var("aws_s3", "g3id", md5(time()));
             }
             module::set_var("aws_s3", "synced", false);
             module::set_var("aws_s3", "enabled", false);
             module::set_var("aws_s3", "access_key", "");
             module::set_var("aws_s3", "secret_key", "");
             module::set_var("aws_s3", "bucket_name", "");
             module::set_version("aws_s3", 1);
         case 1:
             log::info("aws_s3", "Upgrading to version 2");
             $db = Database::instance();
             $db->query("CREATE TABLE {aws_s3_meta} (\n                                `item_id` int(9) NOT NULL,\n                                `item_hash` varchar(32) NOT NULL DEFAULT '',\n                                `thumb_uploaded` smallint(1) NOT NULL DEFAULT 0,\n                                `resize_uploaded` smallint(1) NOT NULL DEFAULT 0,\n                                `fullsize_uploaded` smallint(1) NOT NULL DEFAULT 0,\n                                `local_deleted` smallint(1) NOT NULL DEFAULT 0,\n                                PRIMARY KEY (`item_id`)\n                ) DEFAULT CHARSET=utf8;");
             module::set_var("aws_s3", "upload_thumbs", true);
             module::set_var("aws_s3", "upload_resizes", true);
             module::set_var("aws_s3", "upload_fullsizes", true);
             module::set_var("aws_s3", "s3_storage_only", false);
             if (module::get_var("aws_s3", "synced")) {
                 // v1 has already synced this installation to s3. mark all the items with the relevant meta data
                 $items = ORM::factory("item")->find_all();
                 foreach ($items as $item) {
                     aws_s3::log("Updating S3 meta for item ID: " . $item->id);
                     $item->s3_thumb_uploaded = true;
                     if (!$item->is_album()) {
                         $item->s3_resize_uploaded = true;
                         $item->s3_fullsize_uploaded = true;
                     }
                     $item->s3_local_deleted = false;
                     $item->s3_item_hash = md5($item->relative_path());
                     $item->save_s3_meta();
                 }
             } else {
                 // check various states after upgrade from v1..
                 if (module::get_var("aws_s3", "access_key") != "" && module::get_var("aws_s3", "secret_key") != "" && module::get_var("aws_s3", "bucket_name") != "" && aws_s3::validate_access_details(module::get_var("aws_s3", "access_key"), module::get_var("aws_s3", "secret_key"), module::get_var("aws_s3", "bucket_name"))) {
                     // details are correct but hasn't been synced.
                     if (aws_s3::can_schedule()) {
                         // i can schedule this task
                         aws_s3::schedule_full_sync2();
                         site_status::warning("Your site has been scheduled for full Amazon S3 re-synchronisation. This message will clear when this has been completed.", "aws_s3_not_synced");
                     } else {
                         // i CAN'T schedule it..
                         site_status::warning(t('Your site has not been synchronised to Amazon S3. Until it has, your server will continue to serve image content to your visitors.<br />Click <a href="%url" class="g-dialog-link">here</a> to start the synchronisation task.', array("url" => html::mark_clean(url::site("admin/maintenance/start/aws_s3_task::manual_sync?csrf=__CSRF__")))), "aws_s3_not_synced");
                     }
                 } else {
                     site_status::warning(t('Amazon S3 module needs configuration. Click <a href="%url">here</a> to go to the configuration page.', array("url" => html::mark_clean(url::site("admin/aws_s3")))), "aws_s3_not_configured");
                 }
             }
             module::set_version("aws_s3", 2);
     }
     log::info("aws_s3", "Module upgrade complete");
 }
Exemplo n.º 2
0
 /**
  * @return string An error message suitable for inclusion in the task log
  */
 static function check_index()
 {
     list($remaining) = search::stats();
     if ($remaining) {
         site_status::warning(t('Your search index needs to be updated.  <a href="%url" class="g-dialog-link">Fix this now</a>', array("url" => html::mark_clean(url::site("admin/maintenance/start/search_task::update_index?csrf=__CSRF__")))), "search_index_out_of_date");
     }
 }
Exemplo n.º 3
0
 public function mark_clean_test()
 {
     $safe_string = html::mark_clean("hello <p  >world</p>");
     $this->assert_true($safe_string instanceof SafeString);
     $safe_string_2 = html::clean($safe_string);
     $this->assert_equal("hello <p  >world</p>", $safe_string_2);
 }
Exemplo n.º 4
0
 public function confirm($hash)
 {
     $pending_user = ORM::factory("pending_user")->where("hash", "=", $hash)->where("state", "=", 0)->find();
     if ($pending_user->loaded()) {
         // @todo add a request date to the pending user table and check that it hasn't expired
         $policy = module::get_var("registration", "policy");
         $pending_user->state = 1;
         $pending_user->save();
         if ($policy == "vistor") {
             $user = register::create_new_user($pending_user->id);
             message::success(t("Your registration request has been approved"));
             auth::login($user);
             Session::instance()->set("registration_first_usage", true);
             $pending_user->delete();
         } else {
             site_status::warning(t("There are pending user registration. <a href=\"%url\">Review now!</a>", array("url" => html::mark_clean(url::site("admin/register")), "locale" => module::get_var("gallery", "default_locale"))), "pending_user_registrations");
             message::success(t("Your registration request is awaiting administrator approval"));
             // added by Shad Laws, v2
             if (module::get_var("registration", "admin_notify") == 1) {
                 register::send_admin_notify($pending_user);
             }
         }
     } else {
         message::error(t("Your registration request is no longer valid, Please re-register."));
     }
     url::redirect(item::root()->abs_url());
 }
Exemplo n.º 5
0
 public function index()
 {
     // require_once(MODPATH . "aws_s3/lib/s3.php");
     $form = $this->_get_s3_form();
     if (request::method() == "post") {
         access::verify_csrf();
         if ($form->validate()) {
             module::set_var("aws_s3", "enabled", isset($_POST['enabled']) ? true : false);
             module::set_var("aws_s3", "access_key", $_POST['access_key']);
             module::set_var("aws_s3", "secret_key", $_POST['secret_key']);
             module::set_var("aws_s3", "bucket_name", $_POST['bucket_name']);
             module::set_var("aws_s3", "g3id", $_POST['g3id']);
             module::set_var("aws_s3", "url_str", $_POST['url_str']);
             module::set_var("aws_s3", "sig_exp", $_POST['sig_exp']);
             module::set_var("aws_s3", "use_ssl", isset($_POST['use_ssl']) ? true : false);
             if (module::get_var("aws_s3", "enabled") && !module::get_var("aws_s3", "synced", false)) {
                 site_status::warning(t('Your site has not yet been syncronised with your Amazon S3 bucket. Content will not appear correctly until you perform syncronisation. <a href="%url" class="g-dialog-link">Fix this now</a>', array("url" => html::mark_clean(url::site("admin/maintenance/start/aws_s3_task::sync?csrf=__CSRF__")))), "aws_s3_not_synced");
             }
             message::success(t("Settings have been saved"));
             url::redirect("admin/aws_s3");
         } else {
             message::error(t("There was a problem with the submitted form. Please check your values and try again."));
         }
     }
     $v = new Admin_View("admin.html");
     $v->page_title = t("Amazon S3 Configuration");
     $v->content = new View("admin_aws_s3.html");
     $v->content->form = $form;
     $v->content->end = "";
     echo $v;
 }
Exemplo n.º 6
0
 static function module_change($changes)
 {
     if (!module::is_active("rss") || in_array("rss", $changes->deactivate)) {
         site_status::warning(t("The Slideshow module requires the RSS module.  <a href=\"%url\">Activate the RSS module now</a>", array("url" => html::mark_clean(url::site("admin/modules")))), "slideshow_needs_rss");
     } else {
         site_status::clear("slideshow_needs_rss");
     }
 }
 static function module_change($changes)
 {
     if (!module::is_active("tag") || in_array("tag", $changes->deactivate)) {
         site_status::warning(t("The DisplayTags module requires the Tags module.  <a href=\"%url\">Activate the Tags module now</a>", array("url" => html::mark_clean(url::site("admin/modules")))), "displaytags_needs_tag");
     } else {
         site_status::clear("displaytags_needs_tag");
     }
 }
Exemplo n.º 8
0
 static function module_change($changes)
 {
     // If EXIF is deactivated, display a warning that it is required for this module to function properly.
     if (!module::is_active("exif") || in_array("exif", $changes->deactivate)) {
         site_status::warning(t("The EXIF_GPS module requires the EXIF module.  " . "<a href=\"%url\">Activate the EXIF module now</a>", array("url" => html::mark_clean(url::site("admin/modules")))), "exif_gps_needs_exif");
     } else {
         site_status::clear("exif_gps_needs_exif");
     }
 }
Exemplo n.º 9
0
 static function check_config()
 {
     $public_key = module::get_var("recaptcha", "public_key");
     $private_key = module::get_var("recaptcha", "private_key");
     if (empty($public_key) || empty($private_key)) {
         site_status::warning(t("reCAPTCHA is not quite ready!  Please configure the <a href=\"%url\">reCAPTCHA Keys</a>", array("url" => html::mark_clean(url::site("admin/recaptcha")))), "recaptcha_config");
     } else {
         site_status::clear("recaptcha_config");
     }
 }
Exemplo n.º 10
0
 static function check_config($paths = null)
 {
     if ($paths === null) {
         $paths = unserialize(module::get_var("videos", "authorized_paths"));
     }
     if (empty($paths)) {
         site_status::warning(t("Videos needs configuration. <a href=\"%url\">Configure it now!</a>", array("url" => html::mark_clean(url::site("admin/videos")))), "videos_configuration");
     } else {
         site_status::clear("videos_configuration");
     }
 }
Exemplo n.º 11
0
 /**
  * Show a list of all available, running and finished tasks.
  */
 public function index()
 {
     $query = Database::instance()->query("UPDATE {tasks} SET `state` = 'stalled' " . "WHERE done = 0 " . "AND   state <> 'stalled' " . "AND   unix_timestamp(now()) - updated > 15");
     $stalled_count = $query->count();
     if ($stalled_count) {
         log::warning("tasks", t2("One task is stalled", "%count tasks are stalled", $stalled_count), t('<a href="%url">view</a>', array("url" => html::mark_clean(url::site("admin/maintenance")))));
     }
     $view = new Admin_View("admin.html");
     $view->content = new View("admin_maintenance.html");
     $view->content->task_definitions = task::get_definitions();
     $view->content->running_tasks = ORM::factory("task")->where("done", 0)->orderby("updated", "DESC")->find_all();
     $view->content->finished_tasks = ORM::factory("task")->where("done", 1)->orderby("updated", "DESC")->find_all();
     print $view;
 }
Exemplo n.º 12
0
 /**
  * Show a list of all available, running and finished tasks.
  */
 public function index()
 {
     $query = db::build()->update("tasks")->set("state", "stalled")->where("done", "=", 0)->where("state", "<>", "stalled")->where(new Database_Expression("UNIX_TIMESTAMP(NOW()) - `updated` > 15"))->execute();
     $stalled_count = $query->count();
     if ($stalled_count) {
         log::warning("tasks", t2("One task is stalled", "%count tasks are stalled", $stalled_count), t('<a href="%url">view</a>', array("url" => html::mark_clean(url::site("admin/maintenance")))));
     }
     $view = new Admin_View("admin.html");
     $view->content = new View("admin_maintenance.html");
     $view->content->task_definitions = task::get_definitions();
     $view->content->running_tasks = ORM::factory("task")->where("done", "=", 0)->order_by("updated", "DESC")->find_all();
     $view->content->finished_tasks = ORM::factory("task")->where("done", "=", 1)->order_by("updated", "DESC")->find_all();
     print $view;
 }
Exemplo n.º 13
0
 /**
  * Check whether the module's configured correctly
  * @return boolean
  */
 static function check_config()
 {
     $login = module::get_var("bitly", "login");
     $api_key = module::get_var("bitly", "api_key");
     if (empty($login) || empty($api_key)) {
         site_status::warning(t("bit.ly is not quite ready!  Please provide a <a href=\"%url\">login and API Key</a>", array("url" => html::mark_clean(url::site("admin/bitly")))), "bitly_config");
     } else {
         if (!self::validate_config($login, $api_key)) {
             site_status::warning(t("bit.ly is not properly configured!  URLs will not be shortened until its <a href=\"%url\">configuration</a> is updated.", array("url" => html::mark_clean(url::site("admin/bitly")))), "bitly_config");
         } else {
             site_status::clear("bitly_config");
             return true;
         }
     }
     return false;
 }
Exemplo n.º 14
0
 /**
  * Show a list of all available, running and finished tasks.
  */
 public function index()
 {
     $query = db::build()->update("tasks")->set("state", "stalled")->where("done", "=", 0)->where("state", "<>", "stalled")->where(db::expr("UNIX_TIMESTAMP(NOW()) - `updated` > 15"))->execute();
     $stalled_count = $query->count();
     if ($stalled_count) {
         log::warning("tasks", t2("One task is stalled", "%count tasks are stalled", $stalled_count), t('<a href="%url">view</a>', array("url" => html::mark_clean(url::site("admin/maintenance")))));
     }
     $view = new Admin_View("admin.html");
     $view->page_title = t("Maintenance tasks");
     $view->content = new View("admin_maintenance.html");
     $view->content->task_definitions = task::get_definitions();
     $view->content->running_tasks = ORM::factory("task")->where("done", "=", 0)->order_by("updated", "DESC")->find_all();
     $view->content->finished_tasks = ORM::factory("task")->where("done", "=", 1)->order_by("updated", "DESC")->find_all();
     print $view;
     // Do some maintenance while we're in here
     db::build()->delete("caches")->where("expiration", "<>", 0)->where("expiration", "<=", time())->execute();
     module::deactivate_missing_modules();
 }
Exemplo n.º 15
0
 /**
  * Add Twitter account info to user profiles
  * @param object $data 
  */
 static function show_user_profile($data)
 {
     $twitter_account = ORM::factory("twitter_user")->where("user_id", "=", $data->user->id)->find();
     if ($twitter_account->loaded()) {
         $v = new View("user_profile_info.html");
         $v->user_profile_data = array();
         $fields = array("screen_name" => t("Screen name"));
         foreach ($fields as $field => $label) {
             if (!empty($twitter_account->{$field})) {
                 $value = $twitter_account->{$field};
                 if ($field == "screen_name") {
                     $value = html::mark_clean(html::anchor(twitter::$url . $twitter_account->screen_name, "@{$twitter_account->screen_name}"));
                 }
                 $v->user_profile_data[(string) $label] = $value;
             }
         }
         if (identity::active_user()->id == $data->user->id) {
             $button = html::mark_clean(html::anchor(url::site("twitter/reset/" . $data->user->id), t("Switch to another Twitter screen name")));
             $v->user_profile_data[""] = $button;
         }
         $data->content[] = (object) array("title" => t("Twitter account"), "view" => $v);
     }
 }
Exemplo n.º 16
0
echo url::site("form/add/comments/{$item->id})");
?>
" id="gAddCommentButton"
   class="gButtonLink ui-corner-all ui-icon-left ui-state-default right">
  <span class="ui-icon ui-icon-comment"></span>
  <?php 
echo t("Add a comment");
?>
</a>
<div id="gCommentDetail">
<?php 
if (!$comments->count()) {
    ?>
<p id="gNoCommentsYet">
  <?php 
    echo t("No comments yet. Be the first to <a %attrs>comment</a>!", array("attrs" => html::mark_clean("href=\"#add_comment_form\" class=\"showCommentForm\"")));
    ?>
</p>
<?php 
}
?>
<ul>
  <?php 
foreach ($comments as $comment) {
    ?>
  <li id="gComment-<?php 
    echo $comment->id;
    ?>
">
    <p class="gAuthor">
      <a href="#">
Exemplo n.º 17
0
<?php

defined("SYSPATH") or die("No direct script access.");
?>
<div id="gAdminRecaptcha">
  <h1> <?php 
echo t("reCAPTCHA Challenge Filtering");
?>
 </h1>
  <p>
    <?php 
echo t("reCAPTCHA is a free CAPTCHA service that helps to digitize books, newspapers and old time radio shows.  In order to use it, you need to sign up for a <a href=\"%domain_url\">reCAPTCHA Public/Private Key pair</a>, which is also free.  Once registered, the challenge and response strings are evaluated at <a href=\"%recaptcha_url\">recaptcha.net</a> to determine if the form content has been entered by a bot.", array("domain_url" => $form->get_key_url, "recaptcha_url" => html::mark_clean("http://recaptcha.net")));
?>
  </p>

     <?php 
echo $form;
?>
</div>

<?php 
if ($public_key && $private_key) {
    ?>
<div id="gAdminRecaptchaTest" class="gBlock">
  <h2> <?php 
    echo t("reCAPTCHA Test");
    ?>
 </h2>
  <p>
    <?php 
    echo t("If you see a CAPTCHA form below, then reCAPTCHA is functioning properly.");
Exemplo n.º 18
0
 static function check_config()
 {
     $api_key = module::get_var("akismet", "api_key");
     if (empty($api_key)) {
         site_status::warning(t("Akismet is not quite ready!  Please provide an <a href=\"%url\">API Key</a>", array("url" => html::mark_clean(url::site("admin/akismet")))), "akismet_config");
     } else {
         site_status::clear("akismet_config");
     }
 }
Exemplo n.º 19
0
<?php

defined("SYSPATH") or die("No direct script access.");
?>
<li>
  <?php 
$name = $menu->label->for_html();
?>
  <?php 
$hover_text = t("Your profile")->for_html_attr();
?>
  <?php 
echo t("Logged in as %name", array("name" => html::mark_clean("<a href='{$menu->url}' title='{$hover_text}' id='{$menu->id}'>{$name}</a>")));
?>
</li>
Exemplo n.º 20
0
<?php

defined("SYSPATH") or die("No direct script access.");
?>
<ul class="g-message-block">
  <li class="g-warning"><?php 
echo t("No active sidebar blocks.<br/>\n      <a href=\"%url\">Add blocks</a>", array("url" => html::mark_clean(url::site("admin/sidebar"))));
?>
</li>
</ul>
Exemplo n.º 21
0
        <?php 
if ($can_upgrade) {
    ?>
        <?php 
    if ($done) {
        ?>
        <div id="confirmation">
          <a onclick="$('#confirmation').slideUp(); return false;" href="#" class="close">[x]</a>
          <div>
            <h1> <?php 
        echo t("That's it!");
        ?>
 </h1>
            <p>
              <?php 
        echo t("Your <a href=\"%url\">Gallery</a> is up to date.", array("url" => html::mark_clean(item::root()->url())));
        ?>
            </p>
          </div>
        </div>
        <script type="text/javascript">
          $(document).ready(function() {
            $("#confirmation").css("left", Math.round(($(window).width() - $("#confirmation").width()) / 2));
            $("#confirmation").css("top", Math.round(($(window).height() - $("#confirmation").height()) / 2));
          });
        </script>
        <?php 
    }
    ?>
        <p class="gray_on_done">
          <?php 
Exemplo n.º 22
0
        echo $theme->thumb_info($child);
        ?>
    </ul>
  </li>
  <?php 
    }
} else {
    ?>
  <?php 
    if ($user->admin || access::can("add", $item)) {
        ?>
  <?php 
        $addurl = url::site("uploader/index/{$item->id}");
        ?>
  <li><?php 
        echo t("There aren't any photos here yet! <a %attrs>Add some</a>.", array("attrs" => html::mark_clean("href=\"{$addurl}\" class=\"g-dialog-link\"")));
        ?>
</li>
  <?php 
    } else {
        ?>
  <li><?php 
        echo t("There aren't any photos here yet!");
        ?>
</li>
  <?php 
    }
}
?>
</ul>
<?php 
Exemplo n.º 23
0
<?php

defined("SYSPATH") or die("No direct script access.");
?>
<p>
  <?php 
echo t("This is your administration dashboard and it provides a quick overview of status messages, recent updates, and frequently used options. Add or remove blocks and rearrange them to tailor to your needs. The admin menu provides quick access to all of Gallery 3's options and settings. Here are a few of the most used options to get you started.");
?>
</p>
<ul>
  <li>
    <?php 
echo t("General Settings - choose your <a href=\"%graphics_url\">graphics</a> and <a href=\"%language_url\">language</a> settings.", array("graphics_url" => html::mark_clean(url::site("admin/graphics")), "language_url" => html::mark_clean(url::site("admin/languages"))));
?>
  </li>
  <li>
    <?php 
echo t("Appearance - <a href=\"%theme_url\">choose a theme</a>, or <a href=\"%theme_options_url\">customize the way it looks</a>.", array("theme_url" => html::mark_clean(url::site("admin/themes")), "theme_options_url" => html::mark_clean(url::site("admin/theme_options"))));
?>
  </li>
  <li>
    <?php 
echo t("Customize - <a href=\"%modules_url\">install modules</a> to add cool features!", array("modules_url" => html::mark_clean(url::site("admin/modules"))));
?>
  </li>
</ul>
Exemplo n.º 24
0
 /**
  * Has this Gallery been registered at dev.twitter.com/app?
  * @return boolean
  */
 static function is_registered()
 {
     $consumer_key = module::get_var("twitter", "consumer_key");
     $consumer_secret = module::get_var("twitter", "consumer_secret");
     if (empty($consumer_key) || empty($consumer_secret)) {
         site_status::warning(t("Twitter module requires attention! Set the <a href=\"%url\">consumer key and secret</a>.", array("url" => html::mark_clean(url::site("admin/twitter")))), "twitter_config");
         return false;
     } else {
         site_status::clear("twitter_config");
         return true;
     }
 }
Exemplo n.º 25
0
        ?>
      <li class="gWarning">
        <?php 
        echo t("Your most common thumbnail size in Gallery 2 is %g2_pixels pixels, but your Gallery 3 thumbnail size is set to %g3_pixels pixels. <a href=\"%url\">Using the same value</a> will speed up your import.", array("g2_pixels" => $g2_sizes["thumb"]["size"], "g3_pixels" => $thumb_size, "url" => html::mark_clean(url::site("admin/theme_options"))));
        ?>
      </li>
      <?php 
    }
    ?>

      <?php 
    if ($g2_sizes["resize"]["size"] && $resize_size != $g2_sizes["resize"]["size"]) {
        ?>
      <li class="gWarning">
        <?php 
        echo t("Your most common intermediate size in Gallery 2 is %g2_pixels pixels, but your Gallery 3 thumbnail size is set to %g3_pixels pixels. <a href=\"%url\">Using the same value</a> will speed up your import.", array("g2_pixels" => $g2_sizes["resize"]["size"], "g3_pixels" => $resize_size, "url" => html::mark_clean(url::site("admin/theme_options"))));
        ?>
      </li>
      <?php 
    }
    ?>
    </ul>

    <div class="gInfo">
      <p>
        <?php 
    echo t("Your Gallery 2 has the following importable data in it");
    ?>
      </p>
      <ul>
        <li>
Exemplo n.º 26
0
 private function _share_translations_form()
 {
     $form = new Forge("admin/languages/share", "", "post", array("id" => "g-share-translations-form"));
     $group = $form->group("sharing")->label("Translations API Key");
     $api_key = l10n_client::api_key();
     $server_link = l10n_client::server_api_key_url();
     $group->input("api_key")->label(empty($api_key) ? t("This is a unique key that will allow you to send translations to the remote\n                  server. To get your API key go to %server-link.", array("server-link" => html::mark_clean(html::anchor($server_link)))) : t("API key"))->value($api_key)->error_messages("invalid", t("The API key you provided is invalid."))->error_messages("no_connection", t("Could not connect to remote server to validate the API key."));
     $group->submit("save")->value(t("Save settings"));
     if ($api_key && $this->_outgoing_translations_count()) {
         // TODO: UI improvement: hide API key / save button when API key is set.
         $group->submit("share")->value(t("Submit translations"));
     }
     return $form;
 }
Exemplo n.º 27
0
"
       title="<?php 
    echo t("Login to Gallery")->for_html_attr();
    ?>
"
       id="g-login-link" class="g-dialog-link"><?php 
    echo t("Login");
    ?>
</a>
  </li>
  <?php 
} else {
    ?>
  <li class="first">
    <?php 
    echo t('Logged in as %name', array('name' => html::mark_clean('<a href="' . url::site("form/edit/users/{$user->id}") . '" title="' . t("Edit Your Profile")->for_html_attr() . '" id="g-user-profile-link" class="g-dialog-link">' . html::clean($user->display_name()) . '</a>')));
    ?>
  </li>
  <li>
    <a href="<?php 
    echo url::site("logout?csrf={$csrf}&amp;continue=" . urlencode(url::current(true)));
    ?>
"
       id="g-logout-link"><?php 
    echo t("Logout");
    ?>
</a>
  </li>
  <?php 
}
?>
Exemplo n.º 28
0
 /**
  * This needs to be run once, after the initial install, to choose a graphics toolkit.
  */
 static function choose_default_toolkit()
 {
     // Detect a graphics toolkit
     $toolkits = graphics::detect_toolkits();
     foreach (array("imagemagick", "graphicsmagick", "gd") as $tk) {
         if ($toolkits->{$tk}->installed) {
             module::set_var("gallery", "graphics_toolkit", $tk);
             module::set_var("gallery", "graphics_toolkit_path", $toolkits->{$tk}->dir);
             break;
         }
     }
     if (!module::get_var("gallery", "graphics_toolkit")) {
         site_status::warning(t("Graphics toolkit missing!  Please <a href=\"%url\">choose a toolkit</a>", array("url" => html::mark_clean(url::site("admin/graphics")))), "missing_graphics_toolkit");
     }
 }
<?php

defined("SYSPATH") or die("No direct script access.");
?>
<html>
  <head>
    <title><?php 
echo t("User registration confirmation");
?>
 </title>
  </head>
  <body>
    <h2><?php 
echo t("User registration confirmation");
?>
 </h2>
    <p>
      <?php 
echo t("Hello, %name,", array("name" => $user->full_name ? $user->full_name : $user->name));
?>
    </p>
    <p>
  <?php 
echo t("We received a request to to create a user with this email.  If you made this request, you can confirm it by <a href=\"%confirm_url\">clicking this link</a>.  If you didn't request this password reset, it's ok to ignore this mail.", array("site_url" => html::mark_clean(url::base(false, "http")), "confirm_url" => $confirm_url));
?>
    </p>
  </body>
</html>
Exemplo n.º 30
0
        <?php 
if ($can_upgrade) {
    ?>
        <?php 
    if ($done) {
        ?>
        <div id="confirmation">
          <a onclick="$('#confirmation').slideUp(); return false;" href="#" class="close">[x]</a>
          <div>
            <h1> <?php 
        echo t("That's it!");
        ?>
 </h1>
            <p>
              <?php 
        echo t("Your <a href=\"%url\">Gallery</a> is up to date.", array("url" => html::mark_clean(url::site("albums/1"))));
        ?>
            </p>
          </div>
        </div>
        <script type="text/javascript">
          $(document).ready(function() {
            $("#confirmation").css("left", Math.round(($(window).width() - $("#confirmation").width()) / 2));
            $("#confirmation").css("top", Math.round(($(window).height() - $("#confirmation").height()) / 2));
          });
        </script>
        <?php 
    }
    ?>
        <p class="gray_on_done">
          <?php