/** * @param $user * @return bool * @throws GeneralException */ public function sendConfirmationEmail($user) { //$user can be user instance or id if (!$user instanceof User) { $user = $this->find($user); } Mail::send('frontend.auth.emails.confirm', ['token' => $user->confirmation_code], function ($message) use($user) { $message->to($user->email, $user->name)->subject(app_name() . ': ' . trans('exceptions.frontend.auth.confirmation.confirm')); }); if (count(Mail::failures()) > 0) { throw new GeneralException("There was a problem sending the confirmation e-mail"); } return true; }
function direct($to_email, $subject = '', $body_html = '') { $body_text = html_to_text($body_html); $this->CI->load->library('composer/lib_aws'); $ses_client = $this->CI->lib_aws->get_ses(); try { $result = $ses_client->sendEmail(['Destination' => ['ToAddresses' => [$to_email]], 'Message' => ['Body' => ['Html' => ['Data' => $body_html], 'Text' => ['Data' => $body_text]], 'Subject' => ['Data' => $subject]], 'Source' => '"' . app_name() . '" <' . getenv('email_postmaster') . '>']); } catch (AwsException $e) { // handle the error. $error_msg = 'getAwsRequestId: ' . $e->getAwsRequestId() . ', getAwsErrorType:' . $e->getAwsErrorType() . ', getAwsErrorCode:' . $e->getAwsErrorCode() . "\n\n"; $error_msg .= $e->getMessage() . "\n"; $error_msg .= $e->getTraceAsString(); } if (empty($result)) { $this->error = ['message' => $error_msg]; return NULL; } else { if (!empty($result['MessageId'])) { $result = $result->toArray(); return $result; } else { $this->error = ['message' => 'Result missing MessageId', 'result' => $result]; return NULL; } } }
public function __construct($index = null) { if (defined('DEBUG_ENABLED') && DEBUG_ENABLED && (($fargs = func_get_args()) || ($fargs = 'NOARGS'))) { debug_log('Entered (%%)', 129, 0, __FILE__, __LINE__, __METHOD__, $fargs); } # If we done have a configuration, then our IMGDIR and CSS are not defined if (!defined('IMGDIR')) { define('IMGDIR', 'images/default'); } if (!defined('CSSDIR')) { define('CSSDIR', 'css/default'); } $this->index = $index; # To be defined in a configuration file. $this->_app['title'] = app_name(); $this->_app['logo'] = IMGDIR . '/logo-small.png'; if (!is_null($index)) { $this->_app['urlcss'] = sprintf('%s/%s', CSSDIR, $_SESSION[APPCONFIG]->getValue('appearance', 'stylesheet')); } else { $this->_app['urlcss'] = sprintf('%s/%s', CSSDIR, 'style.css'); } # Default Values for configurable items. $this->_default['sysmsg']['error'] = IMGDIR . '/error-big.png'; $this->_default['sysmsg']['warn'] = IMGDIR . '/warn-big.png'; $this->_default['sysmsg']['info'] = IMGDIR . '/info-big.png'; # Capture any output so far (in case we send some headers below) - there shouldnt be any output anyway. $preOutput = ''; # Try and work around if php compression is on, or the user has set compression in the config. # type = 1 for user gzip, 0 for php.ini gzip. $obStatus = ob_get_status(); if (isset($obStatus['type']) && $obStatus['type'] && $obStatus['status']) { $preOutput = ob_get_contents(); ob_end_clean(); } header('Content-type: text/html; charset="UTF-8"'); if (isCompress()) { header('Content-Encoding: gzip'); if (defined('DEBUG_ENABLED') && DEBUG_ENABLED) { debug_log('Sent COMPRESSED header to browser and discarded (%s)', 129, 0, __FILE__, __LINE__, __METHOD__, $preOutput); } } if (isset($_SESSION[APPCONFIG]) && $_SESSION[APPCONFIG]->getValue('appearance', 'compress') && ini_get('zlib.output_compression')) { $this->setsysmsg(array('title' => _('Warning'), 'body' => _('WARNING: You cannot have PHP compression and application compression enabled at the same time. Please unset zlib.output_compression or set $config->custom->appearance[\'compress\']=false'), 'type' => 'warn')); } # Turn back on output buffering. ob_start(); # Initial Values $this->_pageheader[] .= '<?xml version="1.0" encoding="utf-8"?>' . "\n"; $this->_pageheader[] .= '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML Basic 1.0//EN"' . "\n"; $this->_pageheader[] .= '"http://www.w3.org/TR/xhtml-basic/xhtml-basic10.dtd">' . "\n"; $this->_pageheader[] .= "\n"; $this->_pageheader[] .= '<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="auto" lang="auto" dir="ltr">' . "\n"; $this->_pageheader[] .= "\n"; }
/** * @param $user * @return mixed */ public function sendConfirmationEmail($user) { //$user can be user instance or id if (!$user instanceof User) { $user = User::findOrFail($user); } return Mail::send('emails.confirm', ['token' => $user->confirmation_code], function ($message) use($user) { $message->to($user->email, $user->name)->subject(app_name() . ': Confirma contul!'); }); }
/** * @param $user * @return mixed */ public function sendConfirmationEmail($user) { //$user can be user instance or id if (!$user instanceof User) { $user = $this->find($user); } return Mail::send('frontend.auth.emails.confirm', ['token' => $user->confirmation_code], function ($message) use($user) { $message->to($user->email, $user->name)->subject(app_name() . ': ' . trans('exceptions.frontend.auth.confirmation.confirm')); }); }
/** * Return if this datastore's connection method has been logged into */ public function isLoggedIn($method = null) { if (DEBUG_ENABLED && (($fargs = func_get_args()) || ($fargs = 'NOARGS'))) { debug_log('Entered (%%)', 17, 0, __FILE__, __LINE__, __METHOD__, $fargs); } static $CACHE = array(); $method = $this->getMethod($method); if (isset($CACHE[$this->index][$method]) && !is_null($CACHE[$this->index][$method])) { return $CACHE[$this->index][$method]; } $CACHE[$this->index][$method] = null; # For some authentication types, we need to do the login here switch ($this->getAuthType()) { case 'config': if (!($CACHE[$this->index][$method] = $this->login($this->getLogin($method), $this->getPassword($method), $method))) { system_message(array('title' => _('Unable to login.'), 'body' => _('Your configuration file has authentication set to CONFIG based authentication, however, the userid/password failed to login'), 'type' => 'error')); } break; case 'http': # If our auth vars are not set, throw up a login box. if (!isset($_SERVER['PHP_AUTH_USER'])) { # If this server is not in focus, skip the basic auth prompt. if (get_request('server_id', 'REQUEST') != $this->getIndex()) { $CACHE[$this->index][$method] = false; break; } header(sprintf('WWW-Authenticate: Basic realm="%s %s"', app_name(), _('login'))); if ($_SERVER['SERVER_PROTOCOL'] == 'HTTP/1.0') { header('HTTP/1.0 401 Unauthorized'); } else { header('Status: 401 Unauthorized'); } // http 1.1 method # If we still dont have login details... if (!isset($_SERVER['PHP_AUTH_USER'])) { system_message(array('title' => _('Unable to login.'), 'body' => _('Your configuration file has authentication set to HTTP based authentication, however, there was none presented'), 'type' => 'error')); $CACHE[$this->index][$method] = false; } # Check our auth vars are valid. } else { if (!$this->login($_SERVER['PHP_AUTH_USER'], $_SERVER['PHP_AUTH_PW'], $method)) { system_message(array('title' => _('Unable to login.'), 'body' => _('Your HTTP based authentication is not accepted by the LDAP server'), 'type' => 'error')); $CACHE[$this->index][$method] = false; } else { $CACHE[$this->index][$method] = true; } } break; case 'proxy': $CACHE[$this->index][$method] = $this->login($this->getValue('login', 'bind_id'), $this->getValue('login', 'bind_pass'), $method); break; default: $CACHE[$this->index][$method] = is_null($this->getLogin($method)) ? false : true; } return $CACHE[$this->index][$method]; }
/** * The only function which should be called by a user * * @see common.php * @see APP_SESSION_ID * @return boolean Returns true if the session was started the first time */ function app_session_start() { $sysmsg = null; # If we have a sysmsg before our session has started, then preserve it. if (isset($_SESSION['sysmsg'])) { $sysmsg = $_SESSION['sysmsg']; } /* If session.auto_start is on in the server's PHP configuration (php.ini), then * we will have problems loading our schema cache since the session will have started * prior to loading the SchemaItem (and descedants) class. Destroy the auto-started * session to prevent this problem. */ if (ini_get('session.auto_start') && !array_key_exists(app_session_id_init, $_SESSION)) { @session_destroy(); } # Do we already have a session? if (@session_id()) { return; } @session_name(APP_SESSION_ID); @session_start(); # Do we have a valid session? $is_initialized = is_array($_SESSION) && array_key_exists(app_session_id_init, $_SESSION); if (!$is_initialized) { if (app_session_id_paranoid) { ini_set('session.use_trans_sid', 0); @session_destroy(); @session_id(app_session_get_id()); @session_start(); ini_set('session.use_trans_sid', 1); } $_SESSION[app_session_id_init]['name'] = app_name(); $_SESSION[app_session_id_init]['version'] = app_version(); $_SESSION[app_session_id_init]['config'] = filemtime(CONFDIR . 'config.php'); } @header('Cache-control: private'); // IE 6 Fix if (app_session_id_paranoid && !app_session_verify_id()) { error('Session inconsistent or session timeout', 'error', 'index.php'); } # Check we have the correct version of the SESSION cache if (isset($_SESSION['cache']) || isset($_SESSION[app_session_id_init])) { if (!is_array($_SESSION[app_session_id_init])) { $_SESSION[app_session_id_init] = array(); } if (!isset($_SESSION[app_session_id_init]['version']) || !isset($_SESSION[app_session_id_init]['config']) || !isset($_SESSION[app_session_id_init]['name']) || $_SESSION[app_session_id_init]['name'] !== app_name() || $_SESSION[app_session_id_init]['version'] !== app_version() || $_SESSION[app_session_id_init]['config'] != filemtime(CONFDIR . 'config.php')) { $_SESSION[app_session_id_init]['name'] = app_name(); $_SESSION[app_session_id_init]['version'] = app_version(); $_SESSION[app_session_id_init]['config'] = filemtime(CONFDIR . 'config.php'); unset($_SESSION['cache']); unset($_SESSION[APPCONFIG]); # Our configuration information has changed, so we'll redirect to index.php to get it reloaded again. system_message(array('title' => _('Configuration cache stale.'), 'body' => _('Your configuration has been automatically refreshed.'), 'type' => 'info', 'special' => true)); $config_file = CONFDIR . 'config.php'; $config = check_config($config_file); if (!$config) { debug_dump_backtrace('config is empty?', 1); } } else { # Sanity check, specially when upgrading from a previous release. if (isset($_SESSION['cache'])) { foreach (array_keys($_SESSION['cache']) as $id) { if (isset($_SESSION['cache'][$id]['tree']['null']) && !is_object($_SESSION['cache'][$id]['tree']['null'])) { unset($_SESSION['cache'][$id]); } } } } } # If we came via index.php, then set our $config. if (!isset($_SESSION[APPCONFIG]) && isset($config)) { $_SESSION[APPCONFIG] = $config; } # Restore our sysmsg's if there were any. if ($sysmsg) { if (!isset($_SESSION['sysmsg']) || !is_array($_SESSION['sysmsg'])) { $_SESSION['sysmsg'] = array(); } $_SESSION['sysmsg'] = array_merge($_SESSION['sysmsg'], $sysmsg); } }
protected function getHeader() { $server = $this->getServer(); $type = $this->getType(); $output = ''; $output .= sprintf('# %s %s %s%s', $type['description'], _('for'), implode('|', array_keys($this->results)), $this->br); $output .= sprintf('# %s: %s (%s)%s', _('Server'), $server->getName(), $server->getValue('server', 'host'), $this->br); $output .= sprintf('# %s: %s%s', _('Search Scope'), $this->resultsdata['scope'], $this->br); $output .= sprintf('# %s: %s%s', _('Search Filter'), $this->resultsdata['filter'], $this->br); $output .= sprintf('# %s: %s%s', _('Total Entries'), $this->items, $this->br); $output .= sprintf('#%s', $this->br); $output .= sprintf('# Generated by %s (%s) on %s%s', app_name(), get_href('web'), date('F j, Y g:i a'), $this->br); $output .= sprintf('# Version: %s%s', app_version(), $this->br); $output .= $this->br; return $output; }
function ses_raw_email($message) { $client_name = getenv('app_name'); $to = !empty($message['to_name']) ? '"' . str_replace('"', '\\"', $message['to_name']) . '" <' . $message['to_email'] . '>' : $message['to_email']; // @debug: send to debug // $to = '*****@*****.**'; $subject = $message['subject']; $body_html = $message['body_html']; $body_text = $message['body_text']; $from = !empty($message['from_name']) ? '"' . str_replace('"', '\\"', $message['from_name']) . '" <' . $message['from_email'] . '>' : $message['from_email']; $reply_to = NULL; if (!empty($message['reply_to_email'])) { $reply_to = !empty($message['reply_to_name']) ? $message['reply_to_name'] : $client_name; $reply_to = '"' . str_replace('"', '\\"', $reply_to) . '" <' . $message['reply_to_email'] . '>'; } $msg = ''; $msg .= 'To: ' . $to . "\n"; $msg .= 'From: ' . $from . "\n"; if (!empty($reply_to)) { $msg .= 'Reply-To: ' . $reply_to . "\n"; } // in case you have funny characters in the subject $subject = mb_encode_mimeheader($subject, 'UTF-8'); $msg .= 'Subject: ' . $subject . "\n"; if (!empty($message['list_unsubscribe'])) { $msg .= 'List-Unsubscribe: ' . $message['list_unsubscribe'] . "\n"; } $msg .= 'X-Mailer: ' . $client_name . ' via ' . app_name() . "\n"; $msg .= 'X-About: http://rimeofficial.github.io/postmaster' . "\n"; // random unique string $boundary_hash = md5($message['request_id'] . '.' . time()); $msg .= 'MIME-Version: 1.0' . "\n"; $msg .= 'Content-Type: Multipart/Mixed; boundary="' . $boundary_hash . '"' . "\n"; // now the actual body $msg .= "\n" . '--' . $boundary_hash . "\n"; $msg .= 'Content-type: Multipart/Alternative; boundary="alt-' . $boundary_hash . '"' . "\n"; $msg .= "\n"; // first, the plain text $msg .= 'Content-Type: text/plain; charset="UTF-8"' . "\n"; $msg .= "\n"; $msg .= $body_text; // strip_tags($body); // remove any HTML tags $msg .= "\n"; // now, the html text $msg .= "\n" . '--alt-' . $boundary_hash . "\n"; $msg .= 'Content-Type: text/html; charset="UTF-8"' . "\n"; $msg .= "\n"; $msg .= $body_html; $msg .= "\n"; $msg .= "\n" . '--' . $boundary_hash . '--' . "\n"; return $msg; }
/dist/css/skins/skin-red.min.css" rel="stylesheet" type="text/css" /> <!--[if lt IE 9]> <script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script> <script src="https://oss.maxcdn.com/libs/respond.js/1.3.0/respond.min.js"></script> <![endif]--> </head> <body class="skin-red"> <div class="wrapper"> <header class="main-header"> <!-- Logo --> <a href="<?php echo base_url(); ?> " class="logo"><?php echo app_name(); ?> </a> <!-- Header Navbar: style can be found in header.less --> <nav class="navbar navbar-static-top" role="navigation"> <!-- Sidebar toggle button--> <a href="#" class="sidebar-toggle" data-toggle="offcanvas" role="button"> <span class="sr-only">Toggle navigation</span> </a> <!-- Navbar Right Menu --> <div class="navbar-custom-menu"> <ul class="nav navbar-nav"> <!-- User Account: style can be found in dropdown.less --> <li class="dropdown user user-menu"> <a href="#" > <img src="<?php
public function __construct() { $this->custom = new stdClass(); $this->default = new stdClass(); /* * What to do after entry creation : * 2 : display the creation form again * 1 : display the new created entry * 0 : display the choice between 1 and 2 */ $this->default->appearance['action_after_creation'] = array('desc' => 'Display the new created entry', 'default' => 1); ## Appearance Attributes /** Anonymous implies read only * Set to true if you want LDAP data to be displayed read-only (without input fields) * when a user logs in to a server anonymously */ $this->default->appearance['anonymous_bind_implies_read_only'] = array('desc' => 'Display as read only if user logs in with anonymous bind', 'default' => true); $this->default->appearance['attr_display_order'] = array('desc' => 'Custom order to display attributes', 'default' => array()); /* * @todo Compression is not working, * purge_cache shows blank, * tree refresh shows blank - and if view_tree_node is modified to compress output, then previously opened items show up as compressed data. */ $this->default->appearance['compress'] = array('desc' => 'Compress Output', 'untested' => true, 'default' => false); $this->default->appearance['control_icons'] = array('desc' => 'Show the control as icons or text', 'default' => false); $this->default->appearance['custom_templates_only'] = array('desc' => 'Only display the custom templates.', 'default' => false); $this->default->appearance['date'] = array('desc' => 'Date format whenever dates are shown', 'default' => '%A %e %B %Y'); $this->default->appearance['date_attrs'] = array('desc' => 'Array of attributes that should show a jscalendar', 'default' => array('shadowExpire' => '%es', 'shadowLastChange' => '%es')); $this->default->appearance['date_attrs_showtime'] = array('desc' => 'Array of attributes that should show a the time when showing the jscalendar', 'default' => array('')); $this->default->appearance['disable_default_template'] = array('desc' => 'Disabled the Default Template', 'default' => false); $this->default->appearance['disable_default_leaf'] = array('desc' => 'Disabled creating leaf entries in the Default Template', 'default' => false); $this->default->appearance['friendly_attrs'] = array('desc' => 'Friendly names for attributes', 'default' => array()); $this->default->appearance['hide_attrs'] = array('desc' => 'Hide attributes from display', 'default' => array()); $this->default->appearance['hide_attrs_exempt'] = array('desc' => 'Group DN, where membership will exempt the users from hide_attrs', 'default' => null); $this->default->appearance['hide_debug_info'] = array('desc' => 'Hide the features that may provide sensitive debugging information to the browser', 'default' => true); $this->default->appearance['hide_template_regexp'] = array('desc' => 'Templates that are disabled by their regex are not shown', 'default' => false); $this->default->appearance['hide_template_warning'] = array('desc' => 'Hide template errors from being displayed', 'default' => false); /** Language * The language setting. If you set this to 'auto', phpLDAPadmin will * attempt to determine your language automatically. Otherwise, set * this to your applicable language in xx_XX format. * Localization is not complete yet, but most strings have been translated. * Please help by writing language files. */ $this->default->appearance['language'] = array('desc' => 'Language', 'default' => 'auto'); $this->default->appearance['max_add_attrs'] = array('desc' => 'Maximum number of attrs to show in the add attr form', 'default' => 10); /** * If you want certain attributes to be editable as multi-line, include them in this list * A multi-line textarea will be drawn instead of a single-line text field */ $this->default->appearance['multi_line_attributes'] = array('desc' => 'Attributes to show as multiline attributes', 'default' => array('postalAddress', 'homePostalAddress', 'personalSignature', 'description', 'mailReplyText')); /** * A list of syntax OIDs which support multi-line attribute values: */ $this->default->appearance['multi_line_syntax_oids'] = array('desc' => 'Attributes to show as multiline attributes', 'default' => array('1.3.6.1.4.1.1466.115.121.1.40', '1.3.6.1.4.1.1466.115.121.1.41')); /** Obfuscate Password * If true, display all password hash values as "******". Note that clear-text * passwords will always be displayed as "******", regardless of this setting. */ $this->default->appearance['obfuscate_password_display'] = array('desc' => 'Obfuscate the display of passwords', 'default' => true); $this->default->appearance['page_title'] = array('desc' => 'Change the page title to this text', 'default' => ''); $this->default->appearance['rdn_all_attrs'] = array('desc' => 'Whether to show all attributes in the RDN chooser, or just the required ones', 'default' => true); $this->default->appearance['readonly_attrs'] = array('desc' => 'Mark these attributes as readonly', 'default' => array()); $this->default->appearance['readonly_attrs_exempt'] = array('desc' => 'Group DN, where membership will exempt the users from readonly attrs', 'default' => null); $this->default->appearance['remoteurls'] = array('desc' => 'Whether to include renders for remote URLs', 'default' => true); $this->default->appearance['show_clear_password'] = array('desc' => 'Whether to show clear passwords if we dont obfuscate them', 'default' => false); $this->default->appearance['show_hints'] = array('desc' => 'Show helpful hints', 'default' => true); $this->default->appearance['show_top_create'] = array('desc' => 'Show a additional create link on the top of the list if there are more than 10 entries', 'default' => true); $this->default->appearance['show_schema_link'] = array('desc' => 'Show the schema link for each attribute', 'default' => true); $this->default->appearance['show_attribute_notes'] = array('desc' => 'Show notes for each attribute', 'default' => true); $this->default->appearance['stylesheet'] = array('desc' => 'Style sheet to use', 'default' => 'style.css'); $this->default->appearance['theme'] = array('desc' => 'Which theme to use', 'default' => 'default'); $this->default->appearance['timezone'] = array('desc' => 'Define our timezone, if not defined in php.ini', 'default' => null); $this->default->appearance['tree'] = array('desc' => 'Class name which inherits from Tree class and implements the draw() method', 'default' => 'AJAXTree'); /** Tree display * An array of format strings used to display enties in the * tree viewer (left-hand side). The first format string that * is completely defined (i.e., does not reference attributes * that are not defined the object). If there is no format * string that is completely defined, the last one is used. * * You can use special tokens to draw the entries as you wish. * You can even mix in HTML to format the string. * Here are all the tokens you can use: * %rdn - draw the RDN of the entry (ie, "cn=Dave") * %dn - draw the DN of the entry (ie, "cn=Dave,ou=People,dc=example,dc=com" * %rdnValue - draw the value of the RDN (ie, instead of "cn=Dave", just draw "Dave") * %[attrname]- draw the value (or values) of the specified attribute. * example: %gidNumber * * Any multivalued attributes will be displayed as a comma separated list. * * Examples: * * To draw the gidNumber and uidNumber to the right of the RDN in a small, gray font: * '%rdn <small style="color:gray">( %gidNumber / %uidNumber )</small>' * To draw the full DN of each entry: * '%dn' * To draw the objectClasses to the right in parenthesis: * '%rdn <small style="color: gray">( %objectClass )</small>' * To draw the user-friendly RDN value (ie, instead of "cn=Dave", just draw "Dave"): * '%rdnValue' */ $this->default->appearance['tree_display_format'] = array('desc' => 'LDAP attribute to show in the tree', 'default' => array('%rdn')); $this->default->appearance['tree_height'] = array('desc' => 'Pixel height of the tree browser', 'default' => null); $this->default->appearance['tree_width'] = array('desc' => 'Pixel width of the tree browser', 'default' => null); /** Tree display filter * LDAP filter used to search entries for the tree viewer (left-hand side) */ $this->default->appearance['tree_filter'] = array('desc' => 'LDAP search filter for the tree entries', 'default' => '(objectClass=*)'); # PLA will not display the header and footer parts in minimal mode. $this->default->appearance['minimalMode'] = array('desc' => 'Minimal mode hides header and footer parts', 'default' => false); ## Caching $this->default->cache['schema'] = array('desc' => 'Cache Schema Activity', 'default' => true); $this->default->cache['query'] = array('desc' => 'Cache Query Configuration', 'default' => true); $this->default->cache['query_time'] = array('desc' => 'Cache the query configuration for atleast this amount of time in seconds', 'default' => 5); $this->default->cache['template'] = array('desc' => 'Cache Template Configuration', 'default' => true); $this->default->cache['template_time'] = array('desc' => 'Cache the template configuration for atleast this amount of time in seconds', 'default' => 60); $this->default->cache['tree'] = array('desc' => 'Cache Browser Tree', 'default' => true); /** Confirm actions */ $this->default->confirm['copy'] = array('desc' => 'Confirm copy actions', 'default' => true); $this->default->confirm['create'] = array('desc' => 'Confirm creation actions', 'default' => true); $this->default->confirm['update'] = array('desc' => 'Confirm update actions', 'default' => true); /** Commands * Define command availability ; if the value of a command is true, * the command will be available. */ $this->default->commands['cmd'] = array('desc' => 'Define command availability', 'default' => array('entry_internal_attributes_show' => true, 'entry_refresh' => true, 'oslinks' => true, 'switch_template' => true)); $this->default->commands['script'] = array('desc' => 'Define scripts availability', 'default' => array('add_attr_form' => true, 'add_oclass_form' => true, 'add_value_form' => true, 'collapse' => true, 'compare' => true, 'compare_form' => true, 'copy' => true, 'copy_form' => true, 'create' => true, 'create_confirm' => true, 'delete' => true, 'delete_attr' => true, 'delete_form' => true, 'draw_tree_node' => true, 'expand' => true, 'export' => true, 'export_form' => true, 'import' => true, 'import_form' => true, 'login' => true, 'logout' => true, 'login_form' => true, 'mass_delete' => true, 'mass_edit' => true, 'mass_update' => true, 'modify_member_form' => true, 'monitor' => true, 'purge_cache' => true, 'query_engine' => true, 'rename' => true, 'rename_form' => true, 'rdelete' => true, 'refresh' => true, 'schema' => true, 'server_info' => true, 'show_cache' => true, 'template_engine' => true, 'update_confirm' => true, 'update' => true)); /** Aliases and Referrrals * Similar to ldapsearch's -a option, the following options allow you to configure * how phpLDAPadmin will treat aliases and referrals in the LDAP tree. * For the following four settings, avaialable options include: * * LDAP_DEREF_NEVER - aliases are never dereferenced (eg, the contents of * the alias itself are shown and not the referenced entry). * LDAP_DEREF_SEARCHING - aliases should be dereferenced during the search but * not when locating the base object of the search. * LDAP_DEREF_FINDING - aliases should be dereferenced when locating the base * object but not during the search. * LDAP_DEREF_ALWAYS - aliases should be dereferenced always (eg, the contents * of the referenced entry is shown and not the aliasing entry) * We superceed these definitions with @ to suppress the error if php-ldap is * not installed. */ @($this->default->deref['export'] = array('desc' => '', 'default' => LDAP_DEREF_NEVER)); @($this->default->deref['search'] = array('desc' => '', 'default' => LDAP_DEREF_ALWAYS)); @($this->default->deref['tree'] = array('desc' => '', 'default' => LDAP_DEREF_NEVER)); @($this->default->deref['view'] = array('desc' => '', 'default' => LDAP_DEREF_NEVER)); ## Debug Attributes $this->default->debug['level'] = array('desc' => 'Debug level verbosity', 'default' => 0); $this->default->debug['syslog'] = array('desc' => 'Whether to send debug messages to syslog', 'default' => false); $this->default->debug['file'] = array('desc' => 'Name of file to send debug output to', 'default' => null); $this->default->debug['addr'] = array('desc' => 'IP address of client to provide debugging info.', 'default' => null); $this->default->debug['append'] = array('desc' => 'Whether to append to the debug file, or create it fresh each time', 'default' => true); ## Temp Directories /** JPEG TMPDir * This directory must be readable and writable by your web server */ $this->default->jpeg['tmpdir'] = array('desc' => 'Temporary directory for jpegPhoto data', 'default' => '/tmp'); ## Mass update commands $this->default->mass['enabled'] = array('desc' => 'Are mass update commands enabled', 'default' => true); ## Modify members feature /** * Search filter setting for new members. This is used to search possible members that can be added * to the group. See modify_member_form.php */ $this->default->modify_member['filter'] = array('desc' => 'Search filter for member searches', 'default' => '(objectclass=Person)'); /** * Group attributes. When these attributes are seen in template_engine.php, add "modify group members" * link to the attribute * See template_engine.php */ $this->default->modify_member['groupattr'] = array('desc' => 'Group member attributes', 'default' => array('member', 'uniqueMember', 'memberUid')); /** * Attribute that is added to the group member attribute. For groupOfNames or groupOfUniqueNames this is dn, * for posixGroup it's uid. See modify_member_form.php */ $this->default->modify_member['attr'] = array('desc' => 'Default attribute that is added to the group member attribute', 'default' => 'dn'); /** * Attribute that is added to the group member attribute. * For posixGroup it's uid. See modify_member_form.php */ $this->default->modify_member['posixattr'] = array('desc' => 'Contents of the group member attribute', 'default' => 'uid'); /** * Search filter setting for new members to group. This is used to search possible members that can be added * to the posixGroup. See modify_member_form.php */ $this->default->modify_member['posixfilter'] = array('desc' => 'Search filter for posixmember searches', 'default' => '(uid=*)'); /** * posixGroup attribute. When this attribute are seen in modify_member_form.php, only posixGroup members are shown * See modify_member_form.php */ $this->default->modify_member['posixgroupattr'] = array('desc' => 'posixGroup member attribute', 'default' => 'memberUid'); ## Session Attributes /** Cookie Encryption * phpLDAPadmin can encrypt the content of sensitive cookies if you set this to a big random string. */ $this->default->session['blowfish'] = array('desc' => 'Blowfish key to encrypt cookie details', 'default' => null); /** Cookie Time * If you used auth_type 'form' in the servers list, you can adjust how long the cookie will last * (default is 0 seconds, which expires when you close the browser) */ $this->default->session['cookie_time'] = array('desc' => 'Time in seconds for the life of cookies', 'default' => 0); $this->default->session['http_realm'] = array('desc' => 'HTTP Authentication Realm', 'default' => sprintf('%s %s', app_name(), _('login'))); $this->default->session['memorylimit'] = array('desc' => 'Set the PHP memorylimit warning threshold.', 'default' => 24); $this->default->session['timelimit'] = array('desc' => 'Set the PHP timelimit.', 'default' => 30); /** * Session Menu */ $this->default->menu['session'] = array('desc' => 'Menu items when logged in.', 'default' => array('schema' => true, 'search' => true, 'refresh' => true, 'server_info' => true, 'monitor' => true, 'import' => true, 'export' => true)); ## Password Generation $this->default->password['length'] = array('desc' => 'Length of autogenerated password', 'default' => 8); $this->default->password['numbers'] = array('desc' => 'Number of numbers required in the password', 'default' => 2); $this->default->password['lowercase'] = array('desc' => 'Number of lowercase letters required in the password', 'default' => 2); $this->default->password['uppercase'] = array('desc' => 'Number of uppercase letters required in the password', 'default' => 2); $this->default->password['punctuation'] = array('desc' => 'Number of punctuation letters required in the password', 'default' => 2); $this->default->password['use_similar'] = array('desc' => 'Whether to use similiar characters', 'default' => true); $this->default->password['no_random_crypt_salt'] = array('desc' => 'Disable random salt for crypt()', 'default' => false); /** Search display * By default, when searching you may display a list or a table of results. * Set this to 'table' to see table formatted results. * Set this to 'list' to see "Google" style formatted search results. */ $this->default->search['display'] = array('desc' => 'Display a list or table of search results', 'default' => 'list'); $this->default->search['size_limit'] = array('desc' => 'Limit the size of searchs on the search page', 'default' => 50); /** * The list of attributes to display in each search result entry. * Note that you can add * to the list to display all attributes */ $this->default->search['result_attributes'] = array('desc' => 'List of attributes to display in each search result entry', 'default' => array('cn', 'sn', 'uid', 'postalAddress', 'telephoneNumber')); $this->default->search['time_limit'] = array('desc' => 'Maximum time to allow unlimited size_limit searches to the ldap server', 'default' => 120); }
/** * Get the mail representation of the notification. * * @param mixed $notifiable * @return \Illuminate\Notifications\Messages\MailMessage */ public function toMail($notifiable) { return (new MailMessage())->subject(app_name() . ': ' . trans('exceptions.frontend.auth.confirmation.confirm'))->line(trans('strings.emails.auth.click_to_confirm'))->action(trans('buttons.emails.auth.confirm_account'), route('frontend.auth.account.confirm', $this->confirmation_code))->line(trans('strings.emails.auth.thank_you_for_using_app')); }
echo '</span>'; echo '</center>'; echo '<br />'; } # HTTP Basic Auth Form. if ($app['server']->getAuthType() == 'http') { ob_end_clean(); # When we pop up the basic athentication, we come back to this script, so try the login again. if ($app['server']->isLoggedIn('user')) { if (function_exists('run_hook')) { run_hook('post_login', array('user' => $app['server']->getLogin('user'), 'success' => true)); } system_message(array('title' => _('Authenticate to server'), 'body' => _('Successfully logged into server.'), 'type' => 'info'), sprintf('cmd.php?server_id=%s&refresh=SID_%s', $app['server']->getIndex(), $app['server']->getIndex())); die; } header(sprintf('WWW-Authenticate: Basic realm="%s %s"', app_name(), _('login'))); if ($_SERVER['SERVER_PROTOCOL'] == 'HTTP/1.0') { header('HTTP/1.0 401 Unauthorized'); } else { header('Status: 401 Unauthorized'); } // http 1.1 method return; # HTML Login Form } else { echo '<form action="cmd.php" method="post" name="login_form">'; echo '<input type="hidden" name="cmd" value="login" />'; printf('<input type="hidden" name="server_id" value="%s" />', $app['server']->getIndex()); if (get_request('redirect', 'GET', false, false)) { printf('<input type="hidden" name="redirect" value="%s" />', rawurlencode(get_request('redirect', 'GET'))); }
public function send_mail($token, $to) { $config['mailtype'] = 'html'; $config['protocol'] = 'sendmail'; $config['mailpath'] = '/usr/sbin/sendmail'; $config['charset'] = 'iso-8859-1'; $config['wordwrap'] = TRUE; $this->email->initialize($config); $this->email->from($this->config->item('from'), $this->config->item('from_name')); $this->email->to($to); $this->email->subject(app_name() . " Reset password"); $email_message = "Someone recently requested a link to make password change for your idaciti account. If this was you, you can set a new password through the link below.<br/><br/><br/>"; $email_message .= '<a href="' . site_url('/login/reset_pass?token=' . $token) . '">' . site_url('/login/reset_pass?token=' . $token) . '</a>'; $email_message .= "<br/><br/><br/>If you don't want to change your password or didn't request this, just ignore and delete this message.<br/><br/><br/>Thanks,<br/>Your idaciti Team "; $this->email->message($email_message); if (!$this->email->send()) { log_message('error', 'Email Failed. Debug: ' . $this->email->print_debugger() . " \r\n"); return false; } return true; }
/** * Build the mail representation of the notification. * * @param mixed $notifiable * @return \Illuminate\Notifications\Messages\MailMessage */ public function toMail($notifiable) { return (new MailMessage())->subject(app_name() . ': ' . trans('strings.emails.auth.password_reset_subject'))->line(trans('strings.emails.auth.password_cause_of_email'))->action(trans('buttons.emails.auth.reset_password'), route('frontend.auth.password.reset.form', $this->token))->line(trans('strings.emails.auth.password_if_not_requested')); }
<head> <?php if (empty($title)) { $title = app_name(); } if (empty($description)) { $description = app_name(); } if (empty($keywords)) { $keywords = app_name(); } if (empty($author)) { $author = app_name(); } if (empty($google_verification)) { $google_verification = app_name(); } ?> <meta http-equiv="content-type" content="text/html;charset=UTF-8" /> <meta charset="utf-8" /> <title><?php echo $title; ?> </title> <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" /> <meta name="description" content="<?php echo $description; ?> " /> <meta name="keywords" content="<?php echo $keywords;
public function of_the_day($submit = '') { $current = '/home/admin/'; $data = $this->security($current); if ($data && !empty($data)) { $data['title'] = 'Administration ' . app_name(); $this->load->model('card_of_the_day_model', 'card_otd'); $this->load->model('storyboard_of_the_day_model', 'storyboard_otd'); if (empty($submit)) { $this->load->model('cards_model', 'cards'); $this->load->model('storyboards_model', 'storyboards'); $data['public_cards'] = $this->cards->list_records(array('public' => 1)); $data['public_storyboards'] = $this->storyboards->list_records(array('public' => 1)); $data['card_otd'] = $this->card_otd->get_last_record(); $data['storyboard_otd'] = $this->storyboard_otd->get_last_record(); $this->load->view('general/header', $data); $this->load->view('home/of_the_day', $data); $this->load->view('general/footer'); } else { $action = $this->input->post('action'); $val = $this->input->post('val'); if (!empty($action) && !empty($val)) { if ($action == 'card') { $data = array('card' => $val, 'time' => 'now'); $this->card_otd->add($data); } if ($action == 'storyboard') { $data = array('storyboard' => $val, 'time' => 'now'); $this->storyboard_otd->add($data); } echo 'ok'; } else { echo 'ko'; } } } }
<?php return ['title' => app_name() . ' Installer', 'next' => 'Next Step', 'previous' => 'Previous Step', 'welcome' => ['title' => 'Welcome To The ' . app_name() . ' Installer...', 'message' => 'Welcome to the setup wizard! Please click next to start checking your system requirements.'], 'requirements' => ['title' => 'PHP Modules'], 'permissions' => ['title' => 'Folder Permissions'], 'database' => ['title' => 'Database Installer', 'success' => 'Congratulations! The script has been installed and ready to be used.', 'view-frontend' => 'View Frontend', 'view-backend' => 'View Backend']];
if (isset($app['function_files']) && is_array($app['function_files'])) foreach ($app['function_files'] as $file_name ) { if (! file_exists($file_name)) error(sprintf('Fatal error: Required file "%s" does not exist.',$file_name),'error',null,true); if (! is_readable($file_name)) error(sprintf('Fatal error: Cannot read the file "%s", its permissions may be too strict.',$file_name),'error',null,true); ob_start(); require $file_name; if (ob_get_level()) ob_end_clean(); } # Configuration File check if (! file_exists($app['config_file'])) { error(sprintf(_('You need to configure %s. Edit the file "%s" to do so. An example config file is provided in "%s.example".'),app_name(),$app['config_file'],$app['config_file']),'error',null,true); } elseif (! is_readable($app['config_file'])) { error(sprintf('Fatal error: Cannot read your configuration file "%s", its permissions may be too strict.',$app['config_file']),'error',null,true); } # If our config file fails the sanity check, then stop now. if (! $config = check_config($app['config_file'])) { $www['page'] = new page(); $www['body'] = new block(); $www['page']->block_add('body',$www['body']); $www['page']->display(); exit; } else { app_session_start();
/** * Return if this datastore's connection method has been logged into */ public function isLoggedIn($method = null) { if (DEBUG_ENABLED && (($fargs = func_get_args()) || ($fargs = 'NOARGS'))) { debug_log('Entered (%%)', 17, 0, __FILE__, __LINE__, __METHOD__, $fargs); } static $CACHE = array(); $method = $this->getMethod($method); if (isset($CACHE[$this->index][$method]) && !is_null($CACHE[$this->index][$method])) { return $CACHE[$this->index][$method]; } $CACHE[$this->index][$method] = null; # For some authentication types, we need to do the login here switch ($this->getAuthType()) { case 'config': if (!($CACHE[$this->index][$method] = $this->login($this->getLogin($method), $this->getPassword($method), $method))) { system_message(array('title' => _('Unable to login.'), 'body' => _('Your configuration file has authentication set to CONFIG based authentication, however, the userid/password failed to login'), 'type' => 'error')); } break; case 'http': # If our auth vars are not set, throw up a login box. if (!isset($_SERVER['PHP_AUTH_USER'])) { # If this server is not in focus, skip the basic auth prompt. if (get_request('server_id', 'REQUEST') != $this->getIndex()) { $CACHE[$this->index][$method] = false; break; } header(sprintf('WWW-Authenticate: Basic realm="%s %s"', app_name(), _('login'))); if ($_SERVER['SERVER_PROTOCOL'] == 'HTTP/1.0') { header('HTTP/1.0 401 Unauthorized'); } else { header('Status: 401 Unauthorized'); } // http 1.1 method # If we still dont have login details... if (!isset($_SERVER['PHP_AUTH_USER'])) { system_message(array('title' => _('Unable to login.'), 'body' => _('Your configuration file has authentication set to HTTP based authentication, however, there was none presented'), 'type' => 'error')); $CACHE[$this->index][$method] = false; } # Check our auth vars are valid. } else { if (!$this->login($_SERVER['PHP_AUTH_USER'], $_SERVER['PHP_AUTH_PW'], $method)) { system_message(array('title' => _('Unable to login.'), 'body' => _('Your HTTP based authentication is not accepted by the LDAP server'), 'type' => 'error')); $CACHE[$this->index][$method] = false; } else { $CACHE[$this->index][$method] = true; } } break; case 'proxy': $CACHE[$this->index][$method] = $this->login($this->getValue('login', 'bind_id'), $this->getValue('login', 'bind_pass'), $method); break; case 'sasl': # Propogate any given Kerberos credential cache location if (isset($_ENV['REDIRECT_KRB5CCNAME'])) { putenv(sprintf('KRB5CCNAME=%s', $_ENV['REDIRECT_KRB5CCNAME'])); } elseif (isset($_SERVER['KRB5CCNAME'])) { putenv(sprintf('KRB5CCNAME=%s', $_SERVER['KRB5CCNAME'])); } # Map the SASL auth ID to a DN $regex = $this->getValue('login', 'sasl_dn_regex'); $replacement = $this->getValue('login', 'sasl_dn_replacement'); if ($regex && $replacement) { $userDN = preg_replace($regex, $replacement, $_SERVER['REMOTE_USER']); $CACHE[$this->index][$method] = $this->login($userDN, '', $method); # Otherwise, use the user name as is # For GSSAPI Authentication + mod_auth_kerb and Basic Authentication } else { $CACHE[$this->index][$method] = $this->login(isset($_SERVER['REMOTE_USER']) ? $_SERVER['REMOTE_USER'] : '', '', $method); } break; default: $CACHE[$this->index][$method] = is_null($this->getLogin($method)) ? false : true; } return $CACHE[$this->index][$method]; }