Permalink
Browse files

Fixed login_required feature to use inherit by default

  • Loading branch information...
1 parent 9f9413d commit 8c5e5434903f1c44c13210801c9b3e5e1030dfbd martijn.niji@gmail.com committed Apr 27, 2009
@@ -70,6 +70,7 @@ public function add($parent_id=1)
$page = new Page($data);
$page->parent_id = $parent_id;
$page->status_id = Setting::get('default_status_id');
+ $page->needs_login = Page::LOGIN_INHERIT;
$page_parts = Flash::get('post_parts_data');
@@ -172,9 +172,9 @@
<p style="float: right">
<label for="page_needs_login"><?php echo __('Login:'); ?></label>
<select id="page_needs_login" name="page[needs_login]" title="<?php echo __('When enabled, users have to login before they can view the page.'); ?>">
- <option value="<?php echo Page::LOGIN_NOT_REQUIRED; ?>"<?php echo $page->needs_login == Page::LOGIN_NOT_REQUIRED ? ' selected="selected"': ''; ?>><?php echo __('not required'); ?></option>
- <option value="<?php echo Page::LOGIN_REQUIRED; ?>"<?php echo $page->needs_login == Page::LOGIN_REQUIRED ? ' selected="selected"': ''; ?>><?php echo __('required'); ?></option>
<option value="<?php echo Page::LOGIN_INHERIT; ?>"<?php echo $page->needs_login == Page::LOGIN_INHERIT ? ' selected="selected"': ''; ?>><?php echo __('&#8212; inherit &#8212;'); ?></option>
+ <option value="<?php echo Page::LOGIN_NOT_REQUIRED; ?>"<?php echo $page->needs_login == Page::LOGIN_NOT_REQUIRED ? ' selected="selected"': ''; ?>><?php echo __('not required'); ?></option>
+ <option value="<?php echo Page::LOGIN_REQUIRED; ?>"<?php echo $page->needs_login == Page::LOGIN_REQUIRED ? ' selected="selected"': ''; ?>><?php echo __('required'); ?></option>
</select>
<input id="page_is_protected" name="page[is_protected]" class="checkbox" type="checkbox" value="1"<?php if ($page->is_protected) echo ' checked="checked"'; ?>/><label for="page_is_protected" title="<?php echo __('When enabled, only users who are an administor can edit the page.'); ?>"> <?php echo __('Protected'); ?> </label>
</p>
View
@@ -60,7 +60,7 @@
updated_by_id int(11) default NULL,
position mediumint(6) unsigned default NULL,
is_protected tinyint(1) NOT NULL default '0',
- needs_login tinyint(1) NOT NULL default '0',
+ needs_login tinyint(1) NOT NULL default '2',
PRIMARY KEY (id)
) ENGINE=MyISAM DEFAULT CHARSET=utf8");
@@ -60,7 +60,7 @@
updated_by_id int(11) default NULL ,
position mediumint(6) default NULL ,
is_protected tinyint(1) NOT NULL default '0' ,
- needs_login tinyint(1) NOT NULL default '0'
+ needs_login tinyint(1) NOT NULL default '2'
)");

0 comments on commit 8c5e543

Please sign in to comment.