Initialize repository

Initialize repository from the given URL. Optionally username and
password may be passed to the method, if required for the repository.

@param string $url
@param string $user
@param string $password
@return void
181567
public function initialize($url, $user = null, $password = null)
    {
        if (!is_file($url) || !is_readable($url)) {
            throw new \RuntimeException("Cannot initialize repository from $url");
        }

        // Try to extract given zip archive
        $archive = new \ZipArchive();
        $return  = $archive->open($url);
        if ($return !== true) {
            throw new \RuntimeException($url, $return);
        }

        // Extract, if archive has been opened successfully
        $archive->extractTo($this->root);

        // Move all files from the repository root to the checkout root.
        $root  = $this->findRepositoryRoot($archive);
        $files = glob($this->root . '/' . $root . '*');
        foreach ($files as $file) {
            rename($file, $this->root . '/' . basename($file));
        }
        rmdir($this->root . '/' . $root);

        // Finished Zip extraction
        $archive->close();
    }
766442
public function initialize($url, $user = null, $password = null)
    {
        $count = substr_count($url, '#');
        if ($count === 1) {
            $revision = null;
            list($repoUrl, $module) = explode('#', $url);
        } elseif ($count === 2) {
            list($repoUrl, $module, $revision) = explode('#', $url);
        } else {
            throw new \UnexpectedValueException("No valid VCS url $url");
        }

        $process = new \Arbit\VCSWrapper\CvsCli\Process();
        $process
            ->argument('-d')
            ->argument($repoUrl)
            ->argument('checkout')
            ->argument('-P')
            ->argument('-r')
            ->argument($revision)
            ->argument('-d')
            ->argument($this->root)
            ->argument($module)
            ->execute();
    }
650268
public static void setUser(String userName, String password){
        getImpl().getDirectoryServiceClient().setUser(userName, password);
    }
608784
public function setPassword( core_kernel_classes_Resource $user, $password)
    {
        if(!is_string($password)){
			throw new core_kernel_users_Exception('The password must be of "string" type, got '.gettype($password));
		}
		
		$user->editPropertyValues(new core_kernel_classes_Property(GenerisRdf::PROPERTY_USER_PASSWORD),core_kernel_users_Service::getPasswordHash()->encrypt($password));
    }
459635
public function createUser(User $user, $password)
    {
        $request = $user->toJson();
        $request['password'] = $password;
        $response = $this->client->post('/v2/user', $request);

        return $response['id'];
    }
579454
@SuppressWarnings("unchecked")
    protected void initUserObject() {

        try {
            if (CmsStringUtil.isEmpty(getParamAction()) || CmsDialog.DIALOG_INITIAL.equals(getParamAction())) {
                // edit an existing user, get the user object from db
                m_user = getCms().readUser(new CmsUUID(getParamUserid()));
                if (!Boolean.valueOf(getParamEditall()).booleanValue()) {
                    m_addInfoList = createAddInfoList(m_user);
                } else {
                    setAddInfoMaps();
                }
                return;
            } else {
                // this is not the initial call, get the user object from session
                m_user = getCms().readUser(new CmsUUID(getParamUserid()));
                if (!Boolean.valueOf(getParamEditall()).booleanValue()) {
                    m_addInfoList = (List<CmsUserAddInfoBean>)getDialogObject();
                } else {
                    Map<String, SortedMap<String, Object>> dObj = (Map<String, SortedMap<String, Object>>)getDialogObject();
                    m_addInfoEditable = dObj.get("editable");
                    m_addInfoReadOnly = dObj.get("readonly");
                }
                return;
            }
        } catch (Exception e) {
            // noop
        }
        // create a new user object
        try {
            m_user = getCms().readUser(new CmsUUID(getParamUserid()));
        } catch (CmsException e) {
            // ignore
        }
        if (!Boolean.valueOf(getParamEditall()).booleanValue()) {
            m_addInfoList = createAddInfoList(m_user);
        } else {
            setAddInfoMaps();
        }
    }
94104
public static function init($servicePassword, $url = null)
    {
        self::$servicePassword = $servicePassword;
        if (!is_null($url)) {
            self::setUrl($url);
        }
    }
1149478
public function addUser($username, $password, array $roles)
    {
        $this->userProvider->createUser(new User($username, $password, $roles));
    }
902493
public void init(String url, String user, String pass, String driver) {
		this.driver = StrUtil.isNotBlank(driver) ? driver : DriverUtil.identifyDriver(url);
		try {
			Class.forName(this.driver);
		} catch (ClassNotFoundException e) {
			throw new DbRuntimeException(e, "Get jdbc driver [{}] error!", driver);
		}
		this.url = url;
		this.user = user;
		this.pass = pass;
	}
76950
public function setDigestAuthentication($username, $password = '')
    {
        $this->setOpt(CURLOPT_HTTPAUTH, CURLAUTH_DIGEST);
        $this->setOpt(CURLOPT_USERPWD, $username . ':' . $password);
    }
1332848
protected function resetPassword($user, $password)
    {
        $user->forceFill([
            'password' => bcrypt($password),
            'remember_token' => Str::random(60),
        ])->save();

        $this->guard()->login($user);
    }
9673
@Override
	protected void setInitURI(String uriString) throws CadiException {
		try {
			initURI = new URI(uriString);
		} catch (URISyntaxException e) {
			throw new CadiException(e);
		}
	}
83004
public function initialize($url, $user = null, $password = null)
    {
        if (is_dir($this->root)) {
            if (count(glob($this->root . '/*'))) {
                throw new \RuntimeException("Checkout of $url failed");
            }

            rmdir($this->root);
        }

        $process = new \Arbit\VCSWrapper\GitCli\Process();
        $return = $process->argument('clone')->argument($url)->argument(new \SystemProcess\Argument\PathArgument($this->root))->execute();

        // On windows GIT does not exit with a non-zero exit code on false
        // checkouts, so we need to handle this ourselves
        if ((strtoupper(substr(PHP_OS, 0, 3)) === 'WIN') &&
             (strpos($process->stderrOutput, 'fatal') !== false))
        {
            throw new \SystemProcess\SystemProcessNonZeroExitCodeException(
                128,
                $process->stdoutOutput,
                $process->stderrOutput,
                (string) $process
            );
        }

        // Cache basic revision information for checkout and update
        // currentVersion property.
        $this->getResourceInfo();
    }
984294
protected function setUserInfo($user, $password = null)
    {
        $this->userInfo = $user . ((null !== $password) ? (':' . $password) : '');
    }
368561
public function process($username, $password, $email)
    {
        $dm = $this->documentManager;

        /* @var UserRepository $repo */
        $repo = $dm->getRepository(User::class);
        $credential = $this->credentialFilter->filter($password);
        $info = new Info();
        $info->setEmail($email);
        $user = new User();
        $user
            ->setIsDraft(false)
            ->setRole('admin')
            ->setLogin($username)
            ->setCredential($credential)
            ->setInfo($info)
        ;
        $repo->setEntityPrototype(new User());

        $result = true;
        try{
            $repo->store($user);
        }catch (\Exception $e){
            throw $e;
        }
        return $result;
    }
1335957
public void setUser(String user) {
		if(isModifiable == ModifiableRule.NotModifiable) {
			throw new IllegalArgumentException("not allowed to set user part, the URI is not modifiable");
		}
		try {
			getSipURI().setUser(user);			
		} catch (ParseException e) {
			logger.error("error setting parameter ", e);
		}
	}
106509
public function withUserInfo($user, $password = null)
    {
        $this->user = $user;
        $this->password = $password;

        return $this;
    }