X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=plugins%2FAutoSandbox%2FAutoSandboxPlugin.php;h=bffb84057297c3102c8aa1e3ae748b6c759650b1;hb=78dc376f017cd7a9ee746e961dd8eefb8941eff2;hp=16683e1402589421d9cea0ff73c92f48c3c46b18;hpb=0f1fc36a05c8d858827718255bef20e8d0c0d3f6;p=quix0rs-gnu-social.git diff --git a/plugins/AutoSandbox/AutoSandboxPlugin.php b/plugins/AutoSandbox/AutoSandboxPlugin.php index 16683e1402..bffb840572 100644 --- a/plugins/AutoSandbox/AutoSandboxPlugin.php +++ b/plugins/AutoSandbox/AutoSandboxPlugin.php @@ -59,25 +59,30 @@ class AutoSandboxPlugin extends Plugin function onPluginVersion(&$versions) { $versions[] = array('name' => 'AutoSandbox', - 'version' => STATUSNET_VERSION, + 'version' => GNUSOCIAL_VERSION, 'author' => 'Sean Carmody', 'homepage' => 'http://status.net/wiki/Plugin:AutoSandbox', 'rawdescription' => + // TRANS: Plugin description. _m('Automatically sandboxes newly registered members.')); return true; } function onStartRegistrationFormData($action) { + // TRANS: User instructions after registration. $instr = _m('Note you will initially be "sandboxed" so your posts will not appear in the public timeline.'); if (isset($this->contact)) { - $contactuser = User::staticGet('nickname', $this->contact); - if (!empty($contactuser)) { - $contactlink = "@uri\">$contactuser->nickname"; - // TRANS: $contactlink is a clickable e-mailaddress. - $instr = _m("Note you will initially be \"sandboxed\" so your posts will not appear in the public timeline. ". - 'Send a message to $contactlink to speed up the unsandboxing process.'); + $contactuser = User::getKV('nickname', $this->contact); + if ($contactuser instanceof User) { + $contactlink = sprintf('@%s', + htmlspecialchars($contactuser->getProfile()->getUrl()), + htmlspecialchars($contactuser->getProfile()->getNickname())); + // TRANS: User instructions after registration. + // TRANS: %s is a clickable OStatus profile URL. + $instr = sprintf(_m('Note you will initially be "sandboxed" so your posts will not appear in the public timeline. '. + 'Send a message to %s to speed up the unsandboxing process.'),$contactlink); } } @@ -87,11 +92,11 @@ class AutoSandboxPlugin extends Plugin $action->elementEnd('div'); } - function onEndUserRegister(&$profile,&$user) + public function onEndUserRegister(Profile $profile) { - $profile->sandbox(); - if ($this->debug) { - common_log(LOG_WARNING, "AutoSandbox: sandboxed of $user->nickname"); + $profile->sandbox(); + if ($this->debug) { + common_log(LOG_WARNING, "AutoSandbox: sandboxed of $profile->nickname"); } } }