当前位置: 首页>>代码示例>>PHP>>正文


PHP identity::is_writable方法代码示例

本文整理汇总了PHP中identity::is_writable方法的典型用法代码示例。如果您正苦于以下问题:PHP identity::is_writable方法的具体用法?PHP identity::is_writable怎么用?PHP identity::is_writable使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在identity的用法示例。


在下文中一共展示了identity::is_writable方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: login

 static function login($user)
 {
     if (identity::is_writable()) {
         $user->login_count += 1;
         $user->last_login = time();
         $user->save();
     }
     identity::set_active_user($user);
     log::info("user", t("User %name logged in", array("name" => $user->name)));
     module::event("user_login", $user);
 }
开发者ID:ChrisRut,项目名称:gallery3,代码行数:11,代码来源:auth.php

示例2: show

 public function show($id)
 {
     // If we get here, then we should have a user id other than guest.
     $user = identity::lookup_user($id);
     if (!$user) {
         throw new Kohana_404_Exception();
     }
     $v = new Theme_View("page.html", "other", "profile");
     $v->page_title = t("%name Profile", array("name" => $user->display_name()));
     $v->content = new View("user_profile.html");
     $v->content->user = $user;
     $v->content->contactable = !$user->guest && $user->id != identity::active_user()->id && $user->email;
     $v->content->editable = identity::is_writable() && !$user->guest && $user->id == identity::active_user()->id;
     $event_data = (object) array("user" => $user, "content" => array());
     module::event("show_user_profile", $event_data);
     $v->content->info_parts = $event_data->content;
     print $v;
 }
开发者ID:andyst,项目名称:gallery3,代码行数:18,代码来源:user_profile.php

示例3: show

 public function show($id)
 {
     // If we get here, then we should have a user id other than guest.
     $user = identity::lookup_user($id);
     $active_user = identity::active_user();
     $is_current_active = $active_user->id == $id;
     $display_all = $active_user->admin || $is_current_active && !$active_user->guest;
     $v = new Theme_View("page.html", "other", "profile");
     $v->page_title = t("%name Profile", array("name" => $user->display_name()));
     $v->content = new View("user_profile.html");
     // @todo modify user_home to supply a link to their album,
     $v->content->user = $user;
     $v->content->not_current = !$is_current_active;
     $v->content->editable = identity::is_writable() && $display_all;
     $event_data = (object) array("user" => $user, "display_all" => $display_all, "content" => array());
     module::event("show_user_profile", $event_data);
     $v->content->info_parts = $event_data->content;
     print $v;
 }
开发者ID:joericochuyt,项目名称:gallery3,代码行数:19,代码来源:user_profile.php

示例4: t

        }
        if (data.result == "success") {
          $("#g-dialog").dialog("close");
          window.location.reload();
        }
      }
    });
  };
</script>
<div id="g-login">
  <ul>
    <li id="g-login-form">
      <?php 
echo $form;
?>
    </li>
    <?php 
if (identity::is_writable() && !module::get_var("gallery", "maintenance_mode")) {
    ?>
    <li>
      <a href="#" id="g-password-reset" class="g-right g-text-small"><?php 
    echo t("Forgot your password?");
    ?>
</a>
    </li>
    <?php 
}
?>
  </ul>
</div>
开发者ID:JasonWiki,项目名称:docs,代码行数:30,代码来源:login_ajax.html.php

示例5: function

      success: function(data) {
        if (data.form) {
          $("#g-login form").replaceWith(data.form);
          ajaxify_login_reset_form();
        }
        if (data.result == "success") {
          $("#g-dialog").dialog("close");
          window.location.reload();
        }
      }
    });
  };
</script>
<div id="g-login">
  <ul>
    <li id="g-login-form">
      <?php 
echo $form;
?>
    </li>
    <? if (identity::is_writable()): ?>
    <li>
      <a href="#" id="g-password-reset" class="g-right g-text-small"><?php 
echo t("Forgot your password?");
?>
</a>
    </li>
    <? endif ?>
  </ul>
</div>
开发者ID:ChrisRut,项目名称:gallery3,代码行数:30,代码来源:login_ajax.html.php


注:本文中的identity::is_writable方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。