コード例 #1
0
ファイル: Comment.class.php プロジェクト: Jtgadbois/Pedadida
	/**
	 * @param Contact $user
	 * @return boolean
	 */
	function canEdit(Contact $user) {
		$userId = $user->getId();
		$creatorId = $this->getCreatedById();
		$object = $this->getRelObject();
		if (!$object instanceof ContentDataObject) {
			return false;
		}
		return can_write($user, $object->getMembers(), $object->getObjectTypeId()) && ($user->isAdministrator() || $userId == $creatorId);
	} // canEdit
コード例 #2
0
 /**
  * Returns true if $user can edit this email
  *
  * @param User $user
  * @return boolean
  */
 function canEdit(User $user)
 {
     return can_write($user, $this);
     //		return $this->getAccount()->getUserId() == $user->getId() || $user->isAdministrator();
 }
コード例 #3
0
 /**
  * Check if specific user can edit this file
  *
  * @access public
  * @param User $user
  * @return boolean
  */
 function canEdit(User $user)
 {
     return can_write($user, $this);
 }
コード例 #4
0
 /**
  * Empty implementation of static method. Update tag permissions are check by the taggable
  * object, not tag itself
  *
  * @param User $user
  * @return boolean
  */
 function canEdit(User $user)
 {
     $userId = $user->getId();
     $creatorId = $this->getCreatedById();
     return can_write($user, $this) && ($user->isAdministrator() || $userId == $creatorId);
 }
コード例 #5
0
ファイル: Report.class.php プロジェクト: abhinay100/feng_app
 /**
  * Check if specific user can edit this report
  *
  * @access public
  * @param Contact $user
  * @return boolean
  */
 function canEdit(Contact $user)
 {
     return can_write($user, $this->getMembers(), $this->manager()->getObjectTypeId());
 }
コード例 #6
0
	/**
	 * Returns true if $user can edit this email
	 *
	 * @param Contact $user
	 * @return boolean
	 */
	function canEdit(Contact $user) {	
		$account = $this->getAccount();
		if ($account) {
			return ( 
				$account->getContactId() == logged_user()->getId() || 
				can_write($user, $this->getMembers(), $this->getObjectTypeId())
			);	
		}else{
			return can_write($user, $this->getMembers(), $this->getObjectTypeId());
		}
	} 
コード例 #7
0
 function canCheckin(Contact $user)
 {
     return $this->isCheckedOut() && can_write($user, $this->getMembers(), $this->getObjectTypeId()) && ($user->isAdministrator() || $user->isModerator() || $user->getId() == $this->getCheckedOutById());
 }
コード例 #8
0
 /**
  * Check if specific user can edit this contact
  *
  * @access public
  * @param User $user
  * @return boolean
  */
 function canEdit(User $user)
 {
     if ($this->getUserId()) {
         // a contact that has a user assigned to it can be modified by anybody that can manage security (this is: users and permissions) or the user himself.
         return can_manage_contacts($user, true) || can_manage_security($user) || $this->getUserId() == $user->getId() || can_write($user, $this);
     } else {
         return can_manage_contacts($user, true) || can_write($user, $this);
     }
 }
コード例 #9
0
/**
 * http download a file from the given url and save it into the given filename
 * @param string      $url          url
 * @param string      $path         filename (eg: /tmp/toto.txt)
 * @access public
 * @return void
 */
function wget($url, $path)
{
    if (!can_write($path)) {
        return false;
    }
    $from = @fopen($url, 'rb');
    $to = @fopen($path, 'w');
    $error = false;
    while (!feof($from) && !$error) {
        $buffer = @fread($from, 1024);
        if ($buffer === FALSE || fwrite($to, $buffer) === FALSE) {
            $error = true;
        }
    }
    fclose($to);
    fclose($from);
    if ($error) {
        unlink($to);
    }
    return !$error;
}
コード例 #10
0
 /**
  * Check if specific user can comment this message
  *
  * @access public
  * @param void
  * @return boolean
  */
 function canAddComment(User $user)
 {
     return can_write($user, $this);
 }
コード例 #11
0
	/**
	 * Empty implementation of static method. Update tag permissions are check by the taggable
	 * object, not tag itself
	 *
	 * @param User $user
	 * @return boolean
	 */
	function canEdit(Contact $user) {
		return can_write($user,$this);
	} // canEdit
コード例 #12
0
 /**
  * Can chagne status of this milestone (completed / open)
  *
  * @access public
  * @param User $user
  * @return boolean
  */
 function canChangeStatus(User $user)
 {
     return can_write($user, $this);
 }
コード例 #13
0
 /**
  * Returns true if $user can edit this email
  *
  * @param Contact $user
  * @return boolean
  */
 function canEdit(Contact $user)
 {
     $account = $this->getAccount();
     $members = $this->getMembers();
     $persons_dim = Dimensions::findByCode('feng_persons');
     $tmp = array();
     foreach ($members as $m) {
         if (!$persons_dim instanceof Dimension || $m->getDimensionId() != $persons_dim->getId()) {
             $tmp[] = $m;
         }
     }
     $members = $tmp;
     if ($account instanceof MailAccount) {
         // if classified
         if (count($members) > 0) {
             return $account->getContactId() == logged_user()->getId() || can_write($user, $members, $this->getObjectTypeId());
         } else {
             $macs = MailAccountContacts::instance()->count(array('`account_id` = ? AND `contact_id` = ? AND `can_edit` = 1', $account->getId(), $user->getId()));
             return $account->getContactId() == logged_user()->getId() || $macs > 0;
         }
     } else {
         if (count($members) > 0) {
             return can_write($user, $members, $this->getObjectTypeId());
         } else {
             return false;
         }
     }
 }
コード例 #14
0
	/**
	 * Check if specific user can comment this webpage
	 *
	 * @access public
	 * @param void
	 * @return boolean
	 */
	function canAddComment(Contact $user) {
		return can_write($user, $this->getMembers(), $this->getObjectTypeId());
	} // canAddComment
コード例 #15
0
 /**
  * Check if $user can update webpage options
  *
  * @param User $user
  * @return boolean
  */
 function canUpdateOptions(User $user)
 {
     return can_write($user, $this);
 }
コード例 #16
0
 static function canWrite($bookId = null)
 {
     self::includeBasic();
     $file_id = self::ogBookId();
     if ($file_id == null) {
         return false;
     }
     if ($bookId != self::getGelsheetBookId($file_id)) {
         return false;
     }
     $file = ProjectFiles::findById($file_id);
     if (!$file instanceof ProjectFile) {
         return false;
     }
     return can_write(self::getCompanyWebsite()->getLoggedUser(), $file);
 }
コード例 #17
0
 /**
  * Can chagne status of this milestone (completed / open)
  *
  * @access public
  * @param Contact $contact
  * @return boolean
  */
 function canChangeStatus(Contact $contact)
 {
     return can_write($contact, $this->getMembers(), $this->getObjectTypeId());
 }
コード例 #18
0
 /**
  * Check if specific user can edit this contact
  *
  * @access public
  * @param User $user
  * @return boolean
  */
 function canEdit(Contact $user)
 {
     if ($this->isUser()) {
         // a contact that has a user assigned to it can be modified by anybody that can manage security (this is: users and permissions) or the user himself.
         return can_manage_security($user) && ($this->getUserType() > $user->getUserType() || $user->isAdministrator()) || $this->getObjectId() == $user->getObjectId();
     }
     if ($this->isOwnerCompany()) {
         return can_manage_configuration($user);
     }
     return can_manage_contacts($user) || can_write($user, $this->getMembers(), $this->getObjectTypeId());
 }
コード例 #19
0
		<div class="objectComments" id="<?php 
    echo $random;
    ?>
objectComments" style="<?php 
    echo $countComments > 0 ? '' : 'display:none';
    ?>
">
<?php 
    if (is_array($comments) && count($comments)) {
        $counter = 0;
        foreach ($comments as $comment) {
            $counter++;
            $options = array();
            if ($comment->canEdit(logged_user()) && !$__comments_object->isTrashed()) {
                if ($comment->getCreatedById() == logged_user()->getId() || can_write(logged_user(), $comment->getRelObject()->getMembers(), $comment->getObjectTypeId())) {
                    $options[] = '<a class="internalLink" href="' . $comment->getEditUrl() . '">' . lang('edit') . '</a>';
                }
                if ($comment->canLinkObject(logged_user())) {
                    $options[] = render_link_to_object($comment, lang('link objects'), true);
                }
            }
            if ($comment->canDelete(logged_user()) && !$__comments_object->isTrashed()) {
                $options[] = '<a class="internalLink" href="' . $comment->getDeleteUrl() . '" onclick="return confirm(\'' . escape_single_quotes(lang('confirm move to trash')) . '\')">' . lang('move to trash') . '</a>';
            }
            ?>
			<div class="comment <?php 
            echo $counter % 2 ? 'even' : 'odd';
            ?>
" id="comment<?php 
            echo $comment->getId();
コード例 #20
0
    return $message;
}
function versionPhpCheck()
{
    if (version_compare(PHP_VERSION, '5.4.2') >= 0) {
        return "Pass";
    } elseif (version_compare(PHP_VERSION, '5.3.0', '>=') && version_compare(PHP_VERSION, '5.4.1', '<=')) {
        return "Warning";
    } else {
        return "Fail";
    }
}
$bool = array(true => "Pass", false => "Fail");
$version = versionPhpCheck();
$extensions = get_loaded_extensions();
$writeable = can_write();
$openssl = in_array('openssl', $extensions);
$pdo_sqlite = in_array('pdo_sqlite', $extensions);
$curl = in_array('curl', $extensions);
$curl_version = curl_version();
?>
<h2>Checks php proxy requirements</h2>
<small>* Run this page from a web server directory that includes the proxy.php file</small><br/>
<small>* It's recommended to remove this file from web server once all below tests pass</small>
<br/><br/>
<p>Manually test the web server's configuration by clicking <a href="proxy.config">here</a>.  If the proxy configuration file (proxy.config) displays or gets downloaded, the server is <u>not</u> configured properly to use this proxy (see guide for more details).<br/><br/>


<div class="requirements-div">
<table>
コード例 #21
0
 /**
  * Check if specific user can add task to this list
  *
  * @param Contact $user
  * @return boolean
  */
 function canAddSubTask(Contact $user)
 {
     return can_write($user, $this->getMembers(), $this->getObjectTypeId());
 }
コード例 #22
0
 /**
  * Check if specific user can comment this message
  *
  * @access public
  * @param void
  * @return boolean
  */
 function canAddComment(Contact $contact)
 {
     return can_write($contact, $this->getMembers(), $this->getObjectTypeId());
 }
コード例 #23
0
ファイル: Comment.class.php プロジェクト: rorteg/fengoffice
 /**
  * @param Contact $user
  * @return boolean
  */
 function canEdit(Contact $user)
 {
     $userId = $user->getId();
     $creatorId = $this->getCreatedById();
     $object = $this->getRelObject();
     return can_write($user, $object->getMembers(), $object->getObjectTypeId()) && ($user->isAdministrator() || $userId == $creatorId);
 }
コード例 #24
0
 function canCheckin(User $user)
 {
     return $this->isCheckedOut() && can_write($user, $this) && ($user->isAdministrator() || $user->getId() == $this->getCheckedOutById());
 }
コード例 #25
0
 /**
  * Check if specific user can add task to this list
  *
  * @param User $user
  * @return boolean
  */
 function canAddSubTask(User $user)
 {
     return can_write($user, $this);
 }