Changeset 835
- Timestamp:
- 03/02/09 22:07:05 (15 years ago)
- Location:
- plugins/community
- Files:
-
- 3 added
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
plugins/community/_admin.php
r811 r835 15 15 require dirname(__FILE__).'/_widgets.php'; 16 16 17 $_menu['System']->addItem( 18 __('Community'), 19 'plugin.php?p=community', 20 'index.php?pf=community/icon.png', 21 preg_match('/plugin.php\?p=community(&.*)?$/', 22 $_SERVER['REQUEST_URI']), 23 $core->auth->isSuperAdmin() 24 ); 25 17 26 ?> -
plugins/community/_define.php
r818 r835 17 17 /* Description */ 'Create a blog community while allowing users registrations', 18 18 /* Author */ 'Tomtom (http://plugins.zenstyle.fr/)', 19 /* Version */ '0. 3',19 /* Version */ '0.4', 20 20 /* Permissions */ 'superadmin' 21 21 ); -
plugins/community/_install.php
r811 r835 18 18 19 19 if (version_compare($i_version,$m_version,'>=')) { 20 //return;20 return; 21 21 } 22 22 23 23 $settings = new dcSettings($core,null); 24 24 $settings->setNamespace('community'); 25 $settings->put('community_ activated',false,'boolean','Community activated');25 $settings->put('community_enabled',false,'boolean','Community enabled'); 26 26 $settings->put('community_moderated',false,'boolean','Community moderated'); 27 27 $settings->put('community_admin_email','','string','Community administrator email'); -
plugins/community/_prepend.php
r811 r835 12 12 13 13 $__autoload['community'] = dirname(__FILE__).'/inc/class.community.php'; 14 $__autoload['communityList'] = dirname(__FILE__).'/inc/lib.community.list.php'; 14 15 $__autoload['mail'] = CLEARBRICKS_PATH.'/mail/class.mail.php'; 15 16 -
plugins/community/_public.php
r818 r835 76 76 $login = null; 77 77 } 78 $_ctx->community = new community($core ,$_ctx);78 $_ctx->community = new community($core); 79 79 $_ctx->community->logIn($login,$passwd,$key); 80 80 $_ctx->community = null; … … 100 100 global $core,$_ctx; 101 101 102 if (!$core->blog->settings->community_ activated) {102 if (!$core->blog->settings->community_enabled) { 103 103 self::p404(); 104 104 exit; 105 105 } 106 106 107 $_ctx->community = new community($core ,$_ctx);107 $_ctx->community = new community($core); 108 108 $page = split('/',$args); 109 109 if (count($page) >= 1) { -
plugins/community/default-templates/login.html
r818 r835 80 80 </p> 81 81 <!-- Password --> 82 <p class="field"><label for="li_passwd">{{tpl:lang Pass owrd}} </label>82 <p class="field"><label for="li_passwd">{{tpl:lang Password}} </label> 83 83 <input name="li_passwd" id="li_passwd" type="passwd" size="30" maxlength="255" 84 84 value="" /> -
plugins/community/default-templates/profile.html
r818 r835 75 75 <fieldset> 76 76 <!-- Login --> 77 <p class="field"><label for="p_login" >{{tpl:lang Login}}77 <p class="field"><label for="p_login" class="required">{{tpl:lang Login}} 78 78 <span style="color: red">*</span> </label> 79 79 <input name="p_login" id="p_login" type="text" size="30" maxlength="255" -
plugins/community/inc/class.community.php
r818 r835 21 21 protected $admin_email; 22 22 23 public function __construct(&$core ,&$_ctx)23 public function __construct(&$core) 24 24 { 25 25 $this->core =& $core; 26 $this->_ctx =& $_ctx;27 26 28 27 $this->err = array(); … … 54 53 $account['tz'] = trim($_POST['su_tz']); 55 54 $account['moderated'] = $this->moderated; 55 $account['creadt'] = time() + dt::getTimeOffset($account['tz']); 56 56 $account['key'] = md5(trim($_POST['su_login'])); 57 57 … … 77 77 if (count($this->err) == 0) { 78 78 if ($this->moderated) { 79 $this->sendModerationEmail($account);79 //$this->sendModerationEmail($account); 80 80 } 81 81 else { … … 90 90 public function register($hash) 91 91 { 92 $key = ''; 92 93 foreach ($this->standby as $k => $v) { 93 $key = ($hash == $v['key']) ? $k : '';94 $key = ($hash == $v['key']) ? $k : $key; 94 95 } 95 96 … … 114 115 $cur->user_tz = $this->standby[$key]['tz']; 115 116 $cur->user_options = serialize($user_options); 116 $cur->user_creadt = array( 'NOW()');117 $cur->user_creadt = array($this->standby[$key]['creadt']); 117 118 118 119 $cur->insert(); … … 154 155 setcookie('dc_community_'.$this->core->blog->id,$cookie_community,strtotime('+15 days')); 155 156 } 157 $name = (string)dcUtils::getUserCN($this->core->auth->userID(),$this->core->auth->getInfo('user_name'),$this->core->auth->getInfo('user_firstname'),$this->core->auth->getInfo('user_displayname')); 158 $mail = $this->core->auth->getInfo('user_email'); 159 $site = $this->core->auth->getInfo('user_url'); 160 setrawcookie('comment_info',rawurlencode($name."\n".$mail."\n".$site),strtotime('+30 days')); 156 161 if (isset($_POST['li_login_go'])) { 157 162 http::redirect($this->core->blog->url); … … 167 172 unset($_COOKIE['dc_community_'.$this->core->blog->id]); 168 173 setcookie('dc_community_'.$this->core->blog->id,false,-600); 174 } 175 if (isset($_COOKIE['comment_info'])) { 176 unset($_COOKIE['comment_info']); 177 setcookie('comment_info','',-600); 169 178 } 170 179 http::redirect($this->core->blog->url); … … 236 245 } 237 246 247 public function getStandbyUsers() 248 { 249 return $this->standby; 250 } 251 252 public function delete($id) 253 { 254 if (array_key_exists($id,$this->standby)) { 255 unset($this->standby[$id]); 256 } 257 258 $this->core->blog->settings->setNamespace('community'); 259 $this->core->blog->settings->put('community_standby',serialize($this->standby),'string'); 260 } 261 238 262 protected function sendActivationEmail($account) 239 263 {
Note: See TracChangeset
for help on using the changeset viewer.