1
0
mirror of https://github.com/e107inc/e107.git synced 2025-08-02 20:57:26 +02:00

Issue #6: Remove and optimize (hardcoded) LANS

This commit is contained in:
Lóna Lore
2015-05-07 13:39:09 +02:00
parent 59d3e1504d
commit c0c06e292f
5 changed files with 104 additions and 85 deletions

View File

@@ -76,18 +76,18 @@ class upload_ui extends e_admin_ui
'upload_id' => array ( 'title' => LAN_ID, 'data' => 'int', 'width' => '5%', 'help' => '', 'readParms' => '', 'writeParms' => '', 'class' => 'left', 'thclass' => 'left', ), 'upload_id' => array ( 'title' => LAN_ID, 'data' => 'int', 'width' => '5%', 'help' => '', 'readParms' => '', 'writeParms' => '', 'class' => 'left', 'thclass' => 'left', ),
'upload_datestamp' => array ( 'title' => LAN_DATESTAMP, 'type' => 'datestamp', 'data' => 'int', 'width' => 'auto', 'filter' => true, 'help' => '', 'readParms' => '', 'writeParms' => '', 'class' => 'left', 'thclass' => 'left', ), 'upload_datestamp' => array ( 'title' => LAN_DATESTAMP, 'type' => 'datestamp', 'data' => 'int', 'width' => 'auto', 'filter' => true, 'help' => '', 'readParms' => '', 'writeParms' => '', 'class' => 'left', 'thclass' => 'left', ),
'upload_name' => array ( 'title' => LAN_TITLE, 'type' => 'text', 'data' => 'str', 'width' => 'auto', 'help' => '', 'readParms' => '', 'writeParms' => '', 'class' => 'left', 'thclass' => 'left', 'validate' => true, 'inline' => true), 'upload_name' => array ( 'title' => LAN_TITLE, 'type' => 'text', 'data' => 'str', 'width' => 'auto', 'help' => '', 'readParms' => '', 'writeParms' => '', 'class' => 'left', 'thclass' => 'left', 'validate' => true, 'inline' => true),
'upload_poster' => array ( 'title' => 'Poster', 'type' => 'user', 'data' => 'int', 'width' => 'auto', 'help' => '', 'readParms' => '', 'writeParms' => '', 'class' => 'center', 'thclass' => 'center', ), 'upload_poster' => array ( 'title' => UPLLAN_5, 'type' => 'user', 'data' => 'int', 'width' => 'auto', 'help' => '', 'readParms' => '', 'writeParms' => '', 'class' => 'center', 'thclass' => 'center', ),
'upload_email' => array ( 'title' => 'Email', 'type' => 'text', 'data' => 'str', 'width' => 'auto', 'help' => '', 'readParms' => '', 'writeParms' => '', 'class' => 'center', 'thclass' => 'center', ), 'upload_email' => array ( 'title' => LAN_EMAIL, 'type' => 'text', 'data' => 'str', 'width' => 'auto', 'help' => '', 'readParms' => '', 'writeParms' => '', 'class' => 'center', 'thclass' => 'center', ),
'upload_website' => array ( 'title' => LAN_URL, 'type' => 'url', 'data' => 'str', 'width' => 'auto', 'help' => '', 'readParms' => '', 'writeParms' => '', 'class' => 'left', 'thclass' => 'left', ), 'upload_website' => array ( 'title' => LAN_URL, 'type' => 'url', 'data' => 'str', 'width' => 'auto', 'help' => '', 'readParms' => '', 'writeParms' => '', 'class' => 'left', 'thclass' => 'left', ),
'upload_version' => array ( 'title' => 'Version', 'type' => 'text', 'data' => 'str', 'width' => 'auto', 'help' => '', 'readParms' => '', 'writeParms' => '', 'class' => 'center', 'thclass' => 'center', ), 'upload_version' => array ( 'title' => UPLLAN_9, 'type' => 'text', 'data' => 'str', 'width' => 'auto', 'help' => '', 'readParms' => '', 'writeParms' => '', 'class' => 'center', 'thclass' => 'center', ),
'upload_file' => array ( 'title' => 'File', 'type' => 'text', 'data' => 'str', 'width' => 'auto', 'help' => '', 'readParms' => '', 'writeParms' => '', 'class' => 'center', 'thclass' => 'center', 'validate' => true ), 'upload_file' => array ( 'title' => LAN_FILE, 'type' => 'text', 'data' => 'str', 'width' => 'auto', 'help' => '', 'readParms' => '', 'writeParms' => '', 'class' => 'center', 'thclass' => 'center', 'validate' => true ),
'upload_ss' => array ( 'title' => 'Ss', 'type' => 'text', 'data' => 'str', 'width' => 'auto', 'help' => '', 'readParms' => '', 'writeParms' => '', 'class' => 'center', 'thclass' => 'center', ), 'upload_ss' => array ( 'title' => 'Ss', 'type' => 'text', 'data' => 'str', 'width' => 'auto', 'help' => '', 'readParms' => '', 'writeParms' => '', 'class' => 'center', 'thclass' => 'center', ),
'upload_description' => array ( 'title' => LAN_DESCRIPTION, 'type' => 'textarea', 'data' => 'str', 'width' => '40%', 'help' => '', 'readParms' => '', 'writeParms' => '', 'class' => 'left', 'thclass' => 'left', ), 'upload_description' => array ( 'title' => LAN_DESCRIPTION, 'type' => 'textarea', 'data' => 'str', 'width' => '40%', 'help' => '', 'readParms' => '', 'writeParms' => '', 'class' => 'left', 'thclass' => 'left', ),
'upload_demo' => array ( 'title' => 'Demo', 'type' => 'url', 'data' => 'str', 'width' => 'auto', 'help' => '', 'readParms' => '', 'writeParms' => '', 'class' => 'center', 'thclass' => 'center', ), 'upload_demo' => array ( 'title' => UPLLAN_14, 'type' => 'url', 'data' => 'str', 'width' => 'auto', 'help' => '', 'readParms' => '', 'writeParms' => '', 'class' => 'center', 'thclass' => 'center', ),
'upload_filesize' => array ( 'title' => 'Filesize', 'type' => 'hidden', 'data' => 'int', 'width' => 'auto', 'help' => '', 'readParms' => '', 'writeParms' => '', 'class' => 'center', 'thclass' => 'center', ), 'upload_filesize' => array ( 'title' => UPLLAN_11, 'type' => 'hidden', 'data' => 'int', 'width' => 'auto', 'help' => '', 'readParms' => '', 'writeParms' => '', 'class' => 'center', 'thclass' => 'center', ),
'upload_active' => array ( 'title' => 'Status', 'type' => 'method', 'data' => 'int', 'width' => 'auto', 'help' => '', 'readParms' => '', 'writeParms' => array('singleOption' => true), 'class' => 'center', 'thclass' => 'center', 'batch' => true), 'upload_active' => array ( 'title' => LAN_STATUS, 'type' => 'method', 'data' => 'int', 'width' => 'auto', 'help' => '', 'readParms' => '', 'writeParms' => array('singleOption' => true), 'class' => 'center', 'thclass' => 'center', 'batch' => true),
'upload_category' => array ( 'title' => LAN_CATEGORY, 'type' => 'dropdown', 'data' => 'int', 'width' => 'auto', 'batch' => true, 'filter' => true, 'help' => '', 'readParms' => array(), 'writeParms' => array(), 'class' => 'left', 'thclass' => 'left', 'validate' => true ), 'upload_category' => array ( 'title' => LAN_CATEGORY, 'type' => 'dropdown', 'data' => 'int', 'width' => 'auto', 'batch' => true, 'filter' => true, 'help' => '', 'readParms' => array(), 'writeParms' => array(), 'class' => 'left', 'thclass' => 'left', 'validate' => true ),
'options' => array ( 'title' => 'Options', 'type' => '', 'data' => '', 'width' => '10%', 'thclass' => 'center last', 'class' => 'center last', 'forced' => '1', ), 'options' => array ( 'title' => LAN_OPTIONS, 'type' => '', 'data' => '', 'width' => '10%', 'thclass' => 'center last', 'class' => 'center last', 'forced' => '1', ),
); );
protected $fieldpref = array('checkboxes', 'upload_datestamp', 'upload_name', 'upload_category', 'options'); protected $fieldpref = array('checkboxes', 'upload_datestamp', 'upload_name', 'upload_category', 'options');
@@ -181,7 +181,7 @@ class upload_ui extends e_admin_ui
if($new_data['upload_active'] && !e107::isInstalled('download')) if($new_data['upload_active'] && !e107::isInstalled('download'))
{ {
$this->getModel()->addValidationError('Download plugin is not installed - activation not possible.'); // TODO lan $this->getModel()->addValidationError(UPLLAN_62);
$new_data['upload_active'] = 0; $new_data['upload_active'] = 0;
return $new_data; return $new_data;
} }
@@ -201,11 +201,16 @@ class upload_ui extends e_admin_ui
if(!$sql->delete('upload', 'upload_id='.$id)) if(!$sql->delete('upload', 'upload_id='.$id))
{ {
e107::getMessage() e107::getMessage()
->addError('SQL Error: #'.$sql->getLastErrorNumber().' '.$sql->getLastErrorText(), 'default', $isSession) // TODO lan ->addError(UPLLAN_68.' #'.$sql->getLastErrorNumber().' '.$sql->getLastErrorText(), 'default', $isSession)
->addDebug($sql->getLastQuery(), 'default', $isSession); ->addDebug($sql->getLastQuery(), 'default', $isSession);
} }
// TODO lan else
else e107::getMessage()->addSuccess('Record moved to Downloads. <br><a href="'.e_PLUGIN_ABS.'download/admin_download.php?mode=main&action=edit&id='.$did.'">Manage Download</a>', 'default', $isSession); {
$link = '<br><a href="'.e_PLUGIN_ABS.'download/admin_download.php?mode=main&action=edit&id='.$did.'">'.UPLLAN_64.'</a>';
$message = str_replace('[x]', $link, UPLLAN_63);
e107::getMessage()->addSuccess($message, 'default', $isSession);
}
} }
} }
@@ -235,23 +240,23 @@ class upload_ui extends e_admin_ui
$uploadPath = e_UPLOAD; $uploadPath = e_UPLOAD;
if(!file_exists($uploadPath.$upload['upload_file'])) if(!file_exists($uploadPath.$upload['upload_file']))
{ {
$this->getModel()->addValidationError('File not found'); // TODO lan $this->getModel()->addValidationError(UPLLAN_65);
return false; return false;
} }
$downloadPath = $media->importFile($upload['upload_file'], 'download_file', $uploadPath.$upload['upload_file'], array('media_caption' => $upload['upload_name'])); $downloadPath = $media->importFile($upload['upload_file'], 'download_file', $uploadPath.$upload['upload_file'], array('media_caption' => $upload['upload_name']));
if(false === $downloadPath) if(false === $downloadPath)
{ {
$this->getModel()->addValidationError('Download path error'); // TODO lan $this->getModel()->addValidationError(UPLLAN_66);
return false; return false;
} }
$imagePath = null; $imagePath = null;
if($upload['upload_ss'] && file_exists($uploadPath.$upload['upload_ss'])) if($upload['upload_ss'] && file_exists($uploadPath.$upload['upload_ss']))
{ {
$imagePath = $media->importFile($upload['upload_ss'], '_common_image', $uploadPath.$upload['upload_ss'], array('media_caption' => $upload['upload_name'].' Preview')); // TODO lan $imagePath = $media->importFile($upload['upload_ss'], '_common_image', $uploadPath.$upload['upload_ss'], array('media_caption' => $upload['upload_name'].' '.LAN_PREVIEW));
} }
$author = $upload['upload_poster'] ? e107::getSystemUser($upload['upload_poster'])->getRealName() : 'Anonymous'; // TODO lan $author = $upload['upload_poster'] ? e107::getSystemUser($upload['upload_poster'])->getRealName() : UPLLAN_67;
$dl = array( $dl = array(
'download_name' => $upload['upload_name'], 'download_name' => $upload['upload_name'],
@@ -280,7 +285,7 @@ class upload_ui extends e_admin_ui
$id = $sql->insert('download', $dl); $id = $sql->insert('download', $dl);
if(!$id) if(!$id)
{ {
$this->getModel()->addValidationError('SQL Error: #'.$sql->getLastErrorNumber().' '.$sql->getLastErrorText()); // TODO lan $this->getModel()->addValidationError(UPLLAN_68.' #'.$sql->getLastErrorNumber().' '.$sql->getLastErrorText());
e107::getMessage()->addDebug($sql->getLastQuery()); e107::getMessage()->addDebug($sql->getLastQuery());
return; return;
} }
@@ -299,7 +304,7 @@ class upload_form_ui extends e_admin_form_ui
switch($type) switch($type)
{ {
case 'write': case 'write':
return $this->radio_switch('upload_active', $value, 'Accept', 'Pending', $options); return $this->radio_switch('upload_active', $value, LAN_ACCEPT, LAN_PENDING, $options);
break; break;
case 'read': case 'read':
@@ -318,7 +323,7 @@ class upload_form_ui extends e_admin_form_ui
} }
*/ */
$text = $this->option('Accept', 'upload_active', false, array('other' => 'style="padding-left: 15px"')); $text = $this->option(LAN_ACCEPT, 'upload_active', false, array('other' => 'style="padding-left: 15px"'));
return $text; // $this->option('Accept', 'upload_active', false, array('other' => 'style="padding-left: 15px"')); return $text; // $this->option('Accept', 'upload_active', false, array('other' => 'style="padding-left: 15px"'));

View File

@@ -99,8 +99,10 @@ class users_admin extends e_admin_dispatcher
$id = $_POST['userid']; $id = $_POST['userid'];
$_POST['etrigger_delete'] = array($id => $id); $_POST['etrigger_delete'] = array($id => $id);
$user = e107::getDb()->retrieve('user', 'user_email, user_name', 'user_id='.$id); $user = e107::getDb()->retrieve('user', 'user_email, user_name', 'user_id='.$id);
// TODO lan $rplc_from = array('[x]', '[y]', '[z]');
$this->getController()->deleteConfirmMessage = "You are about to delete {$user['user_name']} ({$user['user_email']}) with ID #{$id}. Are you sure?";// $rplc_to = array($user['user_name'], $user['user_email'], $id);
$message = str_replace($rplc_from, $rplc_to, USRLAN_222);
$this->getController()->deleteConfirmMessage = $message;
} }
break; break;
@@ -470,8 +472,7 @@ class users_admin_ui extends e_admin_ui
if(!$sysuser->getId()) if(!$sysuser->getId())
{ {
// TODO lan e107::getMessage()->addError(USRLAN_223);
e107::getMessage()->addError('User not found.');
return; return;
} }
@@ -502,8 +503,7 @@ class users_admin_ui extends e_admin_ui
$sysuser = e107::getSystemUser($userid, false); $sysuser = e107::getSystemUser($userid, false);
if(!$sysuser->getId()) if(!$sysuser->getId())
{ {
// TODO lan $mes->addError(USRLAN_223);
$mes->addError('User not found.');
return; return;
} }
$row = $sysuser->getData(); $row = $sysuser->getData();
@@ -594,19 +594,17 @@ class users_admin_ui extends e_admin_ui
); );
if($sysuser->email('email', $options)) if($sysuser->email('email', $options))
{ {
// TODO lan $mes->addSuccess(USRLAN_224." ".$sysuser->getName().' ('.$sysuser->getValue('email').')');
$mes->addSuccess("Email sent to: ".$sysuser->getName().' ('.$sysuser->getValue('email').')');
} }
else else
{ {
$mes->addError("Failed to send email to: ".$sysuser->getName().' ('.$sysuser->getValue('email').')'); $mes->addError(USRLAN_225." ".$sysuser->getName().' ('.$sysuser->getValue('email').')');
} }
} }
} }
else else
{ {
// TODO lan $mes->addError(USRLAN_223);
$mes->addError('User not found.');
return; return;
} }
} }
@@ -693,15 +691,12 @@ class users_admin_ui extends e_admin_ui
if(!$user->checkAdminPerms('3')) if(!$user->checkAdminPerms('3'))
{ {
// TODO lan $mes->addError(USRLAN_226, 'default', true);
$mes->addError("You don't have enough permissions to do this.", 'default', true);
// TODO lan
$lan = 'Security violation (not enough permissions) - Administrator --ADMIN_UID-- (--ADMIN_NAME--, --ADMIN_EMAIL--) tried to remove admin status from --UID-- (--NAME--, --EMAIL--)';
$search = array('--UID--', '--NAME--', '--EMAIL--', '--ADMIN_UID--', '--ADMIN_NAME--', '--ADMIN_EMAIL--'); $search = array('--UID--', '--NAME--', '--EMAIL--', '--ADMIN_UID--', '--ADMIN_NAME--', '--ADMIN_EMAIL--');
$replace = array($sysuser->getId(), $sysuser->getName(), $sysuser->getValue('email'), $user->getId(), $user->getName(), $user->getValue('email')); $replace = array($sysuser->getId(), $sysuser->getName(), $sysuser->getValue('email'), $user->getId(), $user->getName(), $user->getValue('email'));
e107::getAdminLog()->log_event('USET_08', str_replace($search, $replace, $lan), E_LOG_INFORMATIVE); e107::getAdminLog()->log_event('USET_08', str_replace($search, $replace, USRLAN_244), E_LOG_INFORMATIVE);
$this->redirect('list', 'main', true); $this->redirect('list', 'main', true);
} }
@@ -719,8 +714,7 @@ class users_admin_ui extends e_admin_ui
} }
else else
{ {
// TODO lan $mes->addError(USRLAN_227);
$mes->addError('Unknown error. Action failed.');
} }
} }
} }
@@ -745,22 +739,18 @@ class users_admin_ui extends e_admin_ui
if(!$user->checkAdminPerms('3')) if(!$user->checkAdminPerms('3'))
{ {
// TODO lan $mes->addError(USRLAN_226, 'default', true);
$mes->addError("You don't have enough permissions to do this.", 'default', true);
// TODO lan
$lan = 'Security violation (not enough permissions) - Administrator --ADMIN_UID-- (--ADMIN_NAME--, --ADMIN_EMAIL--) tried to make --UID-- (--NAME--, --EMAIL--) system admin';
$search = array('--UID--', '--NAME--', '--EMAIL--', '--ADMIN_UID--', '--ADMIN_NAME--', '--ADMIN_EMAIL--'); $search = array('--UID--', '--NAME--', '--EMAIL--', '--ADMIN_UID--', '--ADMIN_NAME--', '--ADMIN_EMAIL--');
$replace = array($sysuser->getId(), $sysuser->getName(), $sysuser->getValue('email'), $user->getId(), $user->getName(), $user->getValue('email')); $replace = array($sysuser->getId(), $sysuser->getName(), $sysuser->getValue('email'), $user->getId(), $user->getName(), $user->getValue('email'));
e107::getLog()->add('USET_08', str_replace($search, $replace, $lan), E_LOG_INFORMATIVE); e107::getLog()->add('USET_08', str_replace($search, $replace, USRLAN_245), E_LOG_INFORMATIVE);
$this->redirect('list', 'main', true); $this->redirect('list', 'main', true);
} }
if(!$sysuser->getId()) if(!$sysuser->getId())
{ {
// TODO lan $mes->addError(USRLAN_223, 'default', true);
$mes->addError("User not found.", 'default', true);
$this->redirect('list', 'main', true); $this->redirect('list', 'main', true);
} }
@@ -777,8 +767,11 @@ class users_admin_ui extends e_admin_ui
// $lan = str_replace(array('--UID--', '--NAME--', '--EMAIL--'), array($sysuser->getId(), $sysuser->getName(), $sysuser->getValue('email')), USRLAN_164); // $lan = str_replace(array('--UID--', '--NAME--', '--EMAIL--'), array($sysuser->getId(), $sysuser->getName(), $sysuser->getValue('email')), USRLAN_164);
// e107::getLog()->add('USET_08', $lan, E_LOG_INFORMATIVE); // e107::getLog()->add('USET_08', $lan, E_LOG_INFORMATIVE);
// $mes->addSuccess($lan); // $mes->addSuccess($lan);
$mes->addWarning("You are about to make User #<b>".$sysuser->getId()."</b> : <b>".$sysuser->getName()."</b> (".$sysuser->getValue('email').") an <b>administrator</b>."); ///TODO LAN $rplc_from = array('[x]', '[y]', '[z]');
$mes->addWarning("Set the permissions and click <b>Update</b> to proceed or <b>Back</b> to abort."); $rplc_to = array($sysuser->getId(), $sysuser->getName(), $sysuser->getValue('email'));
$message = str_replace($rplc_from, $rplc_to, USRLAN_228);
$mes->addWarning($message);
$mes->addWarning(USRLAN_229);
} }
} }
@@ -801,8 +794,7 @@ class users_admin_ui extends e_admin_ui
->appendBody($prm->renderSubmitButtons()) ->appendBody($prm->renderSubmitButtons())
->appendBody($frm->close()); ->appendBody($frm->close());
// TODO lan $this->addTitle(str_replace(array('[x]', '[y]'), array($sysuser->getName(), $sysuser->getValue('email')), USRLAN_230));
$this->addTitle(str_replace(array('{NAME}', '{EMAIL}'), array($sysuser->getName(), $sysuser->getValue('email')), 'Update administrator {NAME} ({EMAIL})'));
} }
protected function checkAllowed($class_id) // check userclass change is permitted. protected function checkAllowed($class_id) // check userclass change is permitted.
@@ -834,8 +826,7 @@ class users_admin_ui extends e_admin_ui
if(!$sysuser->getId()) if(!$sysuser->getId())
{ {
// TODO lan $mes->addError(USRLAN_223);
$mes->addError('User not found.');
return false; return false;
} }
@@ -850,8 +841,7 @@ class users_admin_ui extends e_admin_ui
$a = intval($a); $a = intval($a);
if(!$this->checkAllowed($a)) if(!$this->checkAllowed($a))
{ {
// TODO lan $mes->addError(USRLAN_231);
$mes->addError('Insufficient permissions, operation aborted.');
return false; return false;
} }
@@ -1005,15 +995,13 @@ class users_admin_ui extends e_admin_ui
if(!$sysuser->getId()) if(!$sysuser->getId())
{ {
// TODO lan $mes->addError(USRLAN_223);
$mes->addError('User not found.');
return false; return false;
} }
if(!$key || !$sysuser->getValue('ban')) if(!$key || !$sysuser->getValue('ban'))
{ {
// TODO lan $mes->addError(USRLAN_232);
$mes->addError('Missing activation key.');
return false; return false;
} }
@@ -1076,22 +1064,19 @@ class users_admin_ui extends e_admin_ui
if(!$sysuser->getId()) if(!$sysuser->getId())
{ {
// TODO lan $mes->addError(USRLAN_223, 'default', true);
$mes->addError('User not found.', 'default', true);
$this->redirect('list', 'main', true); $this->redirect('list', 'main', true);
} }
$result = $this->testEmail($email); $result = $this->testEmail($email);
if($result) if($result)
{ {
// TODO lan
$this->setParam('testSucces', $result); $this->setParam('testSucces', $result);
$mes->addSuccess($email.' - Valid'); $mes->addSuccess($email.' - '.USRLAN_233);
} }
else else
{ {
// TODO lan $mes->addError($email.' - '.USRLAN_234, 'default', true);
$mes->addError($email.' - Invalid', 'default', true);
$this->redirect('list', 'main', true); $this->redirect('list', 'main', true);
} }
@@ -1113,8 +1098,7 @@ class users_admin_ui extends e_admin_ui
$email = $sysuser->getValue('email'); $email = $sysuser->getValue('email');
$frm = e107::getForm(); $frm = e107::getForm();
// TODO lan $caption = str_replace('[x]', $email, USRLAN_119);
$caption = "Test ".$email;
$this->addTitle($caption); $this->addTitle($caption);
$text = "<a href='".e_REQUEST_HTTP."?mode=main&amp;action=list'>".LAN_BACK."</a>"; $text = "<a href='".e_REQUEST_HTTP."?mode=main&amp;action=list'>".LAN_BACK."</a>";
@@ -1171,8 +1155,7 @@ class users_admin_ui extends e_admin_ui
if(!$sysuser->getId()) if(!$sysuser->getId())
{ {
// TODO lan e107::getMessage()->addError(USRLAN_223, 'default', true);
$mes->addError('User not found.', 'default', true);
return; return;
} }
@@ -1181,8 +1164,7 @@ class users_admin_ui extends e_admin_ui
if($sysuser->save()) if($sysuser->save())
{ {
// TODO lan e107::getMessage()->addSuccess(USRLAN_235);
e107::getMessage()->addSuccess('User now has to verify.');
// TODO - auto-send email or not - discuss // TODO - auto-send email or not - discuss
$this->resendActivation($userid); $this->resendActivation($userid);
@@ -1194,8 +1176,7 @@ class users_admin_ui extends e_admin_ui
return; return;
} }
// TODO lan e107::getMessage()->addError(USRLAN_236);
e107::getMessage()->addError('Action failed.');
} }
/** /**
@@ -1235,8 +1216,7 @@ class users_admin_ui extends e_admin_ui
if ($allData['data']['user_name'] != $allData['data']['user_loginname']) if ($allData['data']['user_name'] != $allData['data']['user_loginname'])
{ {
$allData['data']['user_name'] = $allData['data']['user_loginname']; $allData['data']['user_name'] = $allData['data']['user_loginname'];
// TODO lan $mes->addWarning(str_replace('[x]', $allData['data']['user_loginname'], USRLAN_237));
$mes->addWarning(str_replace('--NAME--', $allData['data']['user_loginname'], 'User name and display name cannot be different (based on the site configuration). Display name set to <strong>--NAME--</strong>.'));
//$allData['errors']['user_name'] = ERR_FIELDS_DIFFERENT; //$allData['errors']['user_name'] = ERR_FIELDS_DIFFERENT;
} }
} }
@@ -1340,8 +1320,7 @@ class users_admin_ui extends e_admin_ui
$check = $sysuser->email('quickadd', array( $check = $sysuser->email('quickadd', array(
'user_password' => $savePassword, 'user_password' => $savePassword,
'mail_subject' => USRLAN_187.SITENAME, 'mail_subject' => USRLAN_187.SITENAME,
// TODO lan 'activation_url' => USRLAN_238,
'activation_url' => 'Your current status is <strong>Active</strong>',
)); ));
break; break;
@@ -1452,13 +1431,12 @@ class users_admin_ui extends e_admin_ui
</tr> </tr>
<tr> <tr>
<td>Notification and user status</td> <td>".USRLAN_239."</td>
<td> <td>
".$frm->select('sendconfemail', array('0' => "Activate, Don't Notify", '1' => 'Activate, Notify (password)', '2' => 'Require Activation, Notify (password and activation link)'), (int) varset($_POST['sendconfemail'], 0))." ".$frm->select('sendconfemail', array('0' => USRLAN_240, '1' => USRLAN_241, '2' => USRLAN_242), (int) varset($_POST['sendconfemail'], 0))."
<div class='field-help'>".USRLAN_181."</div> <div class='field-help'>".USRLAN_181."</div>
</td> </td>
</tr>"; </tr>";
// TODO lan above
if (!isset ($user_data['user_class'])) $user_data['user_class'] = varset($pref['initial_user_classes']); if (!isset ($user_data['user_class'])) $user_data['user_class'] = varset($pref['initial_user_classes']);
$temp = $e_userclass->vetted_tree('class', array($e_userclass, 'checkbox_desc'), $user_data['user_class'], 'classes, no-excludes'); $temp = $e_userclass->vetted_tree('class', array($e_userclass, 'checkbox_desc'), $user_data['user_class'], 'classes, no-excludes');
@@ -1483,7 +1461,7 @@ class users_admin_ui extends e_admin_ui
<tr> <tr>
<td>".USRLAN_35."</td> <td>".USRLAN_35."</td>
<td> <td>
<a href='#set_perms' class='btn e-expandit'>Set Permissions</a> <a href='#set_perms' class='btn e-expandit'>".USRLAN_243."</a>
<div class='e-hideme' id='set_perms'> <div class='e-hideme' id='set_perms'>
"; ";

View File

@@ -270,6 +270,8 @@ define("LAN_DATESTAMP","Date stamp");
define("LAN_OPTIONAL", "optional"); define("LAN_OPTIONAL", "optional");
define("LAN_INACTIVE","Inactive"); define("LAN_INACTIVE","Inactive");
define("LAN_ACTIVE","Active"); define("LAN_ACTIVE","Active");
define("LAN_ACCEPT","Accept");
define("LAN_PENDING","Pending");
define("LAN_BAN","Ban"); define("LAN_BAN","Ban");
define("LAN_RATING", "Rating"); define("LAN_RATING", "Rating");

View File

@@ -92,13 +92,14 @@ define('UPLLAN_58', 'Default');
define('UPLLAN_59', 'Settings written to '); define('UPLLAN_59', 'Settings written to ');
define('UPLLAN_60', 'Now move this file to '); define('UPLLAN_60', 'Now move this file to ');
define('UPLLAN_61', 'Error writing file: '); define('UPLLAN_61', 'Error writing file: ');
define('UPLLAN_62', '');
define('UPLLAN_63', ''); define('UPLLAN_62', 'Download plugin is not installed - activation not possible.');
define('UPLLAN_64', ''); define('UPLLAN_63', 'Record moved to Downloads. [x]');
define('UPLLAN_65', ''); define('UPLLAN_64', 'Manage Download');
define('UPLLAN_66', ''); define('UPLLAN_65', 'File not found');
define('UPLLAN_67', ''); define('UPLLAN_66', 'Download path error');
define('UPLLAN_68', ''); define('UPLLAN_67', 'Anonymous');
define('UPLLAN_68', 'SQL Error:');
define('UPLLAN_69', ''); define('UPLLAN_69', '');
define('UPLLAN_70', ''); define('UPLLAN_70', '');

View File

@@ -114,6 +114,7 @@ define("USRLAN_115", "Thanks for your registration.");
define("USRLAN_116", "Please confirm that you wish to resend a confirmation email to:"); define("USRLAN_116", "Please confirm that you wish to resend a confirmation email to:");
define("USRLAN_117", "Click the button below to test the following email:"); define("USRLAN_117", "Click the button below to test the following email:");
define("USRLAN_118", "Test Email"); define("USRLAN_118", "Test Email");
define("USRLAN_119", "Test [x]");
define("USRLAN_120", "Set Classes"); define("USRLAN_120", "Set Classes");
define("USRLAN_121", "Mailing"); define("USRLAN_121", "Mailing");
@@ -236,6 +237,38 @@ define('LAN_BOUNCED','Bounced');
define('USRLAN_220', 'All Userclasses'); define('USRLAN_220', 'All Userclasses');
define('USRLAN_221', 'Edit admin perms'); define('USRLAN_221', 'Edit admin perms');
define('USRLAN_222', 'You are about to delete [x] ([y]) with ID #[z]. Are you sure?');
define('USRLAN_223', 'User not found.');
define('USRLAN_224', 'Email sent to:');
define('USRLAN_225', 'Failed to send email to:');
define('USRLAN_226', "You don't have enough permissions to do this.");
define('USRLAN_227', 'Unknown error. Action failed.');
define('USRLAN_228', 'You are about to make User #[b][x][/b] : [b][y][/b] ([z]) an [b]administrator[/b].');
define('USRLAN_229', 'Set the permissions and click [b]Update[/b] to proceed or [b]Back[/b] to abort.');
define('USRLAN_230', 'Update administrator [x] ([y])');
define('USRLAN_231', 'Insufficient permissions, operation aborted.');
define('USRLAN_232', 'Missing activation key.');
define('USRLAN_233', 'Valid');
define('USRLAN_234', 'Invalid');
define('USRLAN_235', 'User now has to verify.');
define('USRLAN_236', 'Action failed.');
define('USRLAN_237', 'User name and display name cannot be different (based on the site configuration). Display name set to [b][x][/b].');
define('USRLAN_238', 'Your current status is [b]Active[/b]');
define('USRLAN_239', 'Notification and user status');
define('USRLAN_240', "Activate, Don't Notify");
define('USRLAN_241', 'Activate, Notify (password)');
define('USRLAN_242', 'Require Activation, Notify (password and activation link)');
define('USRLAN_243', 'Set Permissions');
define('USRLAN_244', 'Security violation (not enough permissions) - Administrator --ADMIN_UID-- (--ADMIN_NAME--, --ADMIN_EMAIL--) tried to remove admin status from --UID-- (--NAME--, --EMAIL--)');
define('USRLAN_245', 'Security violation (not enough permissions) - Administrator --ADMIN_UID-- (--ADMIN_NAME--, --ADMIN_EMAIL--) tried to make --UID-- (--NAME--, --EMAIL--) system admin');
define('USRLAN_246', 'Us');
define('USRLAN_247', 'Us');
define('USRLAN_248', 'Us');
define('USRLAN_249', 'Us');
define('USRLAN_250', 'Us');
// These need review - there are duplicates above - they come from admin/lan_userclass.php. // These need review - there are duplicates above - they come from admin/lan_userclass.php.
define("UCSLAN_1", "Sending notification email to"); define("UCSLAN_1", "Sending notification email to");
define("UCSLAN_2", "Updated Privileges"); define("UCSLAN_2", "Updated Privileges");