public function index() { $folderName = Input::get('folder'); $groupName = Input::has('group') ? shadow(Input::get('group')) : 'all'; $className = 'Strimoid\\Models\\Folders\\' . studly_case($folderName ?: $groupName); if (Input::has('folder') && !class_exists('Folders\\' . studly_case($folderName))) { $user = Input::has('user') ? User::findOrFail(Input::get('user')) : Auth::user(); $folder = Folder::findUserFolderOrFail($user->getKey(), Input::get('folder')); if (!$folder->public && (Auth::guest() || $user->getKey() != Auth::id())) { App::abort(404); } $builder = $folder->entries(); } elseif (class_exists($className)) { $fakeGroup = new $className(); $builder = $fakeGroup->entries(); $builder->orderBy('sticky_global', 'desc'); } else { $group = Group::name($groupName)->firstOrFail(); $group->checkAccess(); $builder = $group->entries(); // Allow group moderators to stick contents $builder->orderBy('sticky_group', 'desc'); } $builder->with(['user', 'group', 'replies', 'replies.user'])->orderBy('created_at', 'desc'); $perPage = Input::has('per_page') ? between(Input::get('per_page'), 1, 100) : 20; return $builder->paginate($perPage); }
function groupHead($title = "Line Rider Share", $color = "243454", $bg = "FFFFFF", $size = 256, $transparent = "no") { if (substr($title, 0, 7) == "<right>") { $align = 'right'; $title = substr($title, 7); } elseif (substr($title, 0, 6) == "<left>") { $align = 'left'; $title = substr($title, 6); } else { $align = 'center'; } shadow($align); if (empty($title)) { $title = "Line Rider Share"; } if (empty($color)) { $color = "243454"; } if (empty($bg)) { $bg = "FFFFFF"; } if (empty($size)) { $size = 256; } if (empty($transparent)) { $transparent = "no"; } echo '<table cellspacing="0" cellpadding="0" border="0" align="' . $align . '">'; echo '<tr><td><img src="group.php?id=tl&color=' . $color . '"></td><td align="left" width="' . $size . '" height="20" background="group.php?id=tm&color=' . $color . '" style="color: #FFFFFF; font-weight: bold;">' . $title . '</td><td><img src="group.php?id=tr&color=' . $color . '"></td></tr>'; echo '<tr><td width="8"'; if ($transparent == "no") { echo ' background="group.php?id=ml&color=' . $color . '&bg=' . $bg . '">'; } elseif ($transparent == "yes") { echo ' background="images/shadowbg.png">'; } elseif ($transparent == "light") { echo ' background="images/lshadowbg.png">'; } elseif ($transparent == "dark") { echo ' background="images/dshadowbg.png">'; } echo '</td><td width="' . $size . '" '; if ($transparent == "no") { echo 'bgcolor="#' . $bg . '"'; } elseif ($transparent == "yes") { echo 'background="images/shadowbg.png"'; } elseif ($transparent == "light") { echo 'background="images/lshadowbg.png"'; } elseif ($transparent == "dark") { echo ' background="images/dshadowbg.png"'; } echo '><table cellpadding="4" cellspacing="0" border="0" width="' . $size . '"><tr><td width="' . $size . '" align="left">'; }
/** * Enables Shadowing on a Sugar Server * * @param STRING $server */ static function shadow($server, $templatePath = null) { if (empty($templatePath) && !empty($_SERVER['DOCUMENT_ROOT'])) { $templatePath = $_SERVER['DOCUMENT_ROOT']; } if (empty($templatePath) && !empty($_SERVER['SHADOW_ROOT'])) { $templatePath = $_SERVER['SHADOW_ROOT']; } $shadow = new SugarShadow($server); $info = $shadow->getServerInfo(); if (empty($templatePath) || empty($info)) { die('<h3>Invalid SugarCRM Instance</h3>'); } else { if (!file_exists($info['path'])) { die('<h3>Invalid SugarCRM Instance</h3>'); } shadow($templatePath, $info['path'], array('cache', 'upload', 'config.php')); } }
} .ui-draggable .ui-dialog-titlebar { cursor: move; } .growl .ui-dialog-titlebar, .growl .ui-dialog-buttonpane, .growl .ui-resizable-se { display:none; } .growl .ui-dialog { top: 20px; right: 20px; } .ui-dialog { border: 5px solid <?php echo $theme; ?> !important; <?php echo roundCorners('10px !important'); ?> <?php echo shadow(); ?> } .growl.ui-dialog:after { content: "[Click to close]"; text-align: right; font-size: 80%; } .ui-menu { list-style: none; padding: 2px; margin: 0; display: block; outline: none; }
/** * @see CliUpgrader::initSugar() */ protected function initSugar() { if ($this->context['stage'] == 'pre' || $this->context['stage'] == 'unpack' || $this->context['stage'] == 'healthcheck') { $templ_dir = $this->context['pre_template']; } else { $templ_dir = $this->context['post_template']; } chdir($templ_dir); $this->log("Shadow configuration: {$templ_dir} -> {$this->context['original_source_dir']}"); shadow($templ_dir, $this->context['original_source_dir'], array("cache", "upload", "config.php")); $this->context['source_dir'] = $templ_dir; return parent::initSugar(); }
/** * * Enables Shadowing on a Sugar Server * @param STRING $server */ static function shadow($server) { $shadow = new SugarShadow($server); $info = $shadow->getServerInfo(); if (empty($info)) { die('<h3>Invalid SugarCRM Instance</h3>'); } else { if (!file_exists($info['path'])) { if ($shadow->config['shadow']['createDir']) { $shadow->createInstance($info['path']); } else { die('<h3>Invalid SugarCRM Instance</h3>'); } } shadow(dirname(__FILE__), $info['path'], array('cache', 'config.php')); } }
echo ' style="color: #CC0000;" title="' . $_SESSION['user'] . ' is an administrator."'; } elseif (rights($_SESSION['user']) == 'moderator') { echo ' style="color: #00CC00;" title="' . $_SESSION['user'] . ' is a moderator."'; } echo '>' . $_SESSION['user'] . '</a></b>'; echo '<br />'; echo '<table cellpadding="0" cellspacing="0" border="0" width="100%"><tr><td>'; echo '<form name="addMessage" action="index.php" method="post">'; echo '<textarea cols="24" rows="8" class="message" name="shoutMessage" maxlength="200" onkeyup="return ismaxlength(this)" wrap="soft"></textarea>'; echo '</form>'; echo '</td><td width="8"></td><td valign="middle">'; shadow(); echo '<input type="image" id="sendMessage" src="images/check.gif" class="shown" onclick="document.getElementById(\'sendMessage\').className=\'hidden\'; document.addMessage.submit();">'; endShadow(); echo '<br /><br />'; shadow(); echo '<input type="image" src="images/cancel.gif" onclick="document.getElementById(\'addMessage\').className = \'shown\';document.getElementById(\'messageBox\').className = \'hidden\';">'; endShadow(); echo '</td></tr></table>'; echo '<br />'; echo '</div>'; echo '</form>'; for ($i = count($shout) - $cInfo - 1; $i >= 0; $i -= $cInfo) { $max--; if ($max < 0) { break; } echo '<b><a href="analyze.php?u=' . $shout[$i] . '"'; if (rights($shout[$i]) == 'admin') { echo ' style="color: #CC0000;" title="' . $shout[$i] . ' is an administrator."'; } elseif (rights($shout[$i]) == 'moderator') {
if (is_file($XMailFile) != true || $Passwords != 'clear' && $Passwords != 'md5') { Help(); } $handle = fopen($XMailFile, 'r'); if ($handle) { if (!($Write_handle = fopen($WriteFile, 'w'))) { echo "Cannot open file {$WriteFile} for writing !\n"; exit; } while (!feof($handle)) { //$line = explode("\t",str_replace('"','',trim(fgets($handle, 4096)))); $line = array_pad(explode("\t", str_replace('"', '', trim(fgets($handle, 4096)))), 2, null); if ($line[1]) { switch ($Passwords) { case 'md5': $line = $line[1] . '@' . $line[0] . ':' . shadow(DecryptXMailPassword($line[2])) . "\n"; break; case 'clear': $line = $line[1] . '@' . $line[0] . ':' . DecryptXMailPassword($line[2]) . "\n"; break; } if (fwrite($Write_handle, $line) === FALSE) { echo "Cannot write to file {$WriteFile}!!\n"; exit; } } } fclose($Write_handle); fclose($handle); echo "Converted {$XMailFile} to {$WriteFile} using {$Passwords} method!\n"; }
$unzip_dir = getcwd(); $logpath = $path = $instance_path . "/shadow_upgrade.log"; // FIXME: can we use regular pre-post scripts? define('SUGARCRM_PRE_INSTALL_FILE', "{$unzip_dir}/scripts/shadow_pre_install.php"); define('SUGARCRM_POST_INSTALL_FILE', "{$unzip_dir}/scripts/shadow_post_install.php"); echo "\n"; echo "********************************************************************\n"; echo "************** This Upgrade process may take some time *************\n"; echo "********************************************************************\n"; echo "\n"; $errors = array(); $cwd = $instance_path; chdir($template); //ini_set('error_reporting',1); //set_include_path($template.PATH_SEPARATOR.$instance_path.PATH_SEPARATOR.get_include_path()); shadow($template, $instance_path, array('cache', 'custom', 'config.php')); require_once 'include/entryPoint.php'; require_once 'include/SugarLogger/SugarLogger.php'; require_once 'include/utils/zip_utils.php'; require_once 'modules/UpgradeWizard/uw_utils.php'; require_once "modules/Administration/QuickRepairAndRebuild.php"; require_once 'modules/Administration/Administration.php'; require_once 'modules/Administration/upgrade_custom_relationships.php'; require_once 'modules/MySettings/TabController.php'; require "{$instance_path}/config.php"; require_once "sugar_version.php"; // provides $sugar_version & $sugar_flavor $log = LoggerManager::getLogger('SugarCRM'); $db = DBManagerFactory::getInstance(); $UWstrings = return_module_language('en_us', 'UpgradeWizard'); $adminStrings = return_module_language('en_us', 'Administration');
public function authenticate($user_, $password_) { if (!is_object($user_)) { Logger::error('main', 'UserDB::sql_external::authenticate user_ paramater is not an object'); return false; } if (!$user_->hasAttribute('login')) { Logger::error('main', 'UserDB::sql_external::authenticate user has not attribute login'); return false; } if (!$user_->hasAttribute('password')) { Logger::error('main', 'UserDB::sql_external::authenticate user has not attribute password'); return false; } $login = $user_->getAttribute('login'); $password_db = $user_->getAttribute('password'); $prefs = Preferences::getInstance(); if (!$prefs) { die_error('get Preferences failed', __FILE__, __LINE__); } $config = $prefs->get('UserDB', 'sql_external'); if (!is_array($config)) { Logger::error('main', 'UserDB::sql_external::authenticate fail to get preferences'); return false; } if (!array_key_exists('hash_method', $config)) { Logger::error('main', 'UserDB::sql_external::authenticate no hash method'); return false; } $method = $config['hash_method']; if ($method == 'plain') { return $password_ == $password_db; } else { if ($method == 'crypt') { $hash = crypt($password_, $login); return $password_db == $hash; } else { if ($method == 'md5') { return md5($password_) == $password_db; } else { if ($method == 'shadow') { return shadow($password_db, $password_); } else { Logger::error('main', 'UserDB::sql_external::authenticate hash method \'' . $method . '\' does not support'); return false; } } } } return false; }