WordPress

Briefly unavailable for scheduled maintenance.
Check back in a some hours.
403WebShell
403Webshell
Server IP : 38.242.244.58  /  Your IP : 216.73.217.62
Web Server : Apache/2.4.41 (Ubuntu)
System : Linux vmi1486879.contaboserver.net 5.4.0-166-generic #183-Ubuntu SMP Mon Oct 2 11:28:33 UTC 2023 x86_64
User : root ( 0)
PHP Version : 7.4.3-4ubuntu2.19
Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,pcntl_unshare,
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : ON  |  Pkexec : OFF
Directory :  /var/www/html/sura/src/Entity/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /var/www/html/sura/src/Entity/User.php
<?php
// src/Entity/User.php

namespace App\Entity;

use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use FOS\UserBundle\Model\User as BaseUser;
use Doctrine\ORM\Mapping as ORM;
use FOS\UserBundle\Model\UserInterface;
use Symfony\Component\Serializer\Annotation\Groups;
use Captcha\Bundle\CaptchaBundle\Validator\Constraints as CaptchaAssert;


/**
 * @ORM\Entity
 * @ORM\Table(name="fos_user")
 */
class User extends BaseUser implements UserInterface
{
    const IDENTITY_NOT_UPLOADED=0;
    const IDENTITY_UPLOADED=1;
    const IDENTITY_VERIFIED=2;
    const IDENTITY_REJECTED=-1;
    /**
     * @Groups({"elastica"})
     * @ORM\Id
     * @ORM\Column(type="integer")
     * @ORM\GeneratedValue(strategy="AUTO")
     */
    protected $id;


    /**
     * @ORM\Column(type="string", length=255)
     */
    private $FirstName;

    /**
     * @ORM\Column(type="string", length=255)
     */
    private $LastName;

    /**
     * @ORM\OneToMany(targetEntity="App\Entity\Stock", mappedBy="contributor", orphanRemoval=true)
     */
    private $stocks;

    /**
     * @ORM\OneToMany(targetEntity="App\Entity\Release", mappedBy="createBy")
     */
    private $releases;

    /**
     * @ORM\OneToMany(targetEntity="App\Entity\StockModel", mappedBy="model")
     */
    private $stockModels;

    /**
     * @ORM\OneToMany(targetEntity="App\Entity\Stock", mappedBy="approveBy")
     */
    private $approvedStocks;

    /**
     * @ORM\OneToOne(targetEntity="App\Entity\PayoutDetails", mappedBy="user")
     */
    private $payoutDetails;

    /**
     * @ORM\Column(type="integer")
     */
    private $IdentityVerified=0;
    /**
     * @ORM\Column(type="boolean")
     */
    private $registrationComplete=0;

    /**
     * @ORM\Column(type="string", length=255, nullable=true)
     */
    private $IdentityFile;

    /**
     * @ORM\ManyToOne(targetEntity="App\Entity\User", inversedBy="models")
     */
    private $CreateBy;

    /**
     * @ORM\OneToMany(targetEntity="App\Entity\User", mappedBy="CreateBy")
     */
    private $models;

    /**
     * @ORM\OneToOne(targetEntity="App\Entity\Model", mappedBy="user", cascade={"persist", "remove"})
     */
    private $model;

    /**
     * @ORM\OneToMany(targetEntity="App\Entity\Model", mappedBy="createdBy")
     */
    private $createdModels;

    /**
     * @ORM\OneToOne(targetEntity="App\Entity\FtpUser", mappedBy="user", cascade={"persist", "remove"})
     */
    private $ftpUser;

    /**
     * @ORM\OneToMany(targetEntity="App\Entity\MyModel", mappedBy="Model")
     */
    private $myModels;

    /**
     * @ORM\OneToMany(targetEntity="App\Entity\MyModel", mappedBy="Contributor")
     */
    private $myContributors;

    /**
     * @ORM\Column(type="string", length=255, nullable=true)
     */
    private $phoneNumber;

    /**
     * @ORM\Column(type="string", length=255, nullable=true)
     */
    private $Avatar;

    /**
     * @ORM\OneToOne(targetEntity="App\Entity\Cart", mappedBy="Buyer", cascade={"persist", "remove"})
     */
    private $cart;

    /**
     * @ORM\OneToMany(targetEntity="App\Entity\Invoice", mappedBy="CreateBy")
     */
    private $createdInvoices;

    /**
     * @ORM\OneToMany(targetEntity="App\Entity\Payouts", mappedBy="PayoutTo")
     */
    private $payouts;

    /**
     * @ORM\Column(type="datetime", nullable=true)
     */
    private $joinedOn;

    /**
     * @ORM\Column(type="string", length=255, nullable=true)
     */
    private $securityCode;

    /**
     * @Groups({"elastica"})
     * @ORM\Column(type="boolean", nullable=true)
     */
    private $is_exclusive;

    /**
     * @ORM\ManyToOne(targetEntity="App\Entity\User")
     */
    private $approver;

    /**
     * @ORM\Column(type="text", nullable=true)
     */
    private $rejectReason;

    /**
     * @ORM\ManyToOne(targetEntity="App\Entity\User")
     */
    private $rejectedBy;

    /**
     * @ORM\Column(type="datetime", nullable=true)
     */
    private $rejectedAt;

    /**
     * @ORM\Column(type="datetime", nullable=true)
     */
    private $approvedAt;

    /**
     * @ORM\Column(type="boolean", nullable=true)
     */
    private $suspended_member;

    /**
     * @ORM\Column(type="string", length=255, nullable=true)
     */
    private $suspension_reason;

    /**
     * @ORM\Column(type="integer", nullable=true )
     */
    private $oldID;

    /**
     * @ORM\Column(type="string", length=500,nullable=true)
     */
    private $facebookId;

    /**
     * @ORM\OneToMany(targetEntity="App\Entity\StockRecentViews", mappedBy="user")
     */
    private $stockRecentViews;

    /**
     * @ORM\OneToMany(targetEntity="App\Entity\EmailSubscription", mappedBy="User")
     */
    private $emailSubscriptions;

    /**
     * @ORM\Column(type="boolean")
     */
    private $termsAgreement = false;

    /**
     * @ORM\Column(type="text", nullable=true)
     */
    private $exclusive_termination;


    protected $captchaCode;



    const SUB_ADMINS = "ROLE_SUB_ADMIN";

    public function getAvatarUrl(){
        if($this->Avatar !== null){
           return '/uploads/avatar/'.$this->getAvatar();
        }
        else{
            return '/images/avatar_placeholder.jpg';
        }
    }


    public function __construct()
    {
        parent::__construct();
        $this->stocks = new ArrayCollection();
        $this->releases = new ArrayCollection();
        $this->stockModels = new ArrayCollection();
        $this->approvedStocks = new ArrayCollection();

        $this->models = new ArrayCollection();
        $this->createdModels = new ArrayCollection();
        $this->myModels = new ArrayCollection();
        $this->myContributors = new ArrayCollection();
        $this->createdInvoices = new ArrayCollection();
        $this->payouts = new ArrayCollection();
//        $this->invoices = new ArrayCollection();
        // your own logic

        //date joined
        date_default_timezone_set("Africa/Nairobi");
        if (empty($this->joinedOn)){
            $this->joinedOn = new \DateTime();
        }
        $this->stockRecentViews = new ArrayCollection();
        $this->emailSubscriptions = new ArrayCollection();
    }

    /**
     * @return mixed
     */
    public function getOldID()
    {
        return $this->oldID;
    }

    /**
     * @param mixed $oldID
     */
    public function setOldID($oldID)
    {
        $this->oldID = $oldID;
    }



    public function getFullName(){
        return $this->FirstName.' '.$this->LastName;
    }

    public function getFirstName(): ?string
    {
        return $this->FirstName;
    }

    public function setFirstName(string $FirstName): self
    {
        $this->FirstName = $FirstName;

        return $this;
    }

    public function getLastName(): ?string
    {
        return $this->LastName;
    }

    public function getEmail()
    {
        return parent::getEmail(); // TODO: Change the autogenerated stub
    }

    public function setLastName($LastName): self
    {
        $this->LastName = $LastName;

        return $this;
    }

    /**
     * @return Collection|Stock[]
     */
    public function getStocks(): Collection
    {
        return $this->stocks;
    }

    public function addStock(Stock $stock): self
    {
        if (!$this->stocks->contains($stock)) {
            $this->stocks[] = $stock;
            $stock->setContributor($this);
        }

        return $this;
    }

    public function removeStock(Stock $stock): self
    {
        if ($this->stocks->contains($stock)) {
            $this->stocks->removeElement($stock);
            // set the owning side to null (unless already changed)
            if ($stock->getContributor() === $this) {
                $stock->setContributor(null);
            }
        }

        return $this;
    }

    /**
     * @return Collection|Release[]
     */
    public function getReleases(): Collection
    {
        return $this->releases;
    }

    public function addRelease(Release $release): self
    {
        if (!$this->releases->contains($release)) {
            $this->releases[] = $release;
            $release->setCreateBy($this);
        }

        return $this;
    }

    public function removeRelease(Release $release): self
    {
        if ($this->releases->contains($release)) {
            $this->releases->removeElement($release);
            // set the owning side to null (unless already changed)
            if ($release->getCreateBy() === $this) {
                $release->setCreateBy(null);
            }
        }

        return $this;
    }

    /**
     * @return Collection|StockModel[]
     */
    public function getStockModels(): Collection
    {
        return $this->stockModels;
    }

    public function addStockModel(StockModel $stockModel): self
    {
        if (!$this->stockModels->contains($stockModel)) {
            $this->stockModels[] = $stockModel;
            $stockModel->setModel($this);
        }

        return $this;
    }

    public function removeStockModel(StockModel $stockModel): self
    {
        if ($this->stockModels->contains($stockModel)) {
            $this->stockModels->removeElement($stockModel);
            // set the owning side to null (unless already changed)
            if ($stockModel->getModel() === $this) {
                $stockModel->setModel(null);
            }
        }

        return $this;
    }

    /**
     * @return Collection|Stock[]
     */
    public function getApprovedStocks(): Collection
    {
        return $this->approvedStocks;
    }

    public function addApprovedStock(Stock $approvedStock): self
    {
        if (!$this->approvedStocks->contains($approvedStock)) {
            $this->approvedStocks[] = $approvedStock;
            $approvedStock->setApproveBy($this);
        }

        return $this;
    }

    public function removeApprovedStock(Stock $approvedStock): self
    {
        if ($this->approvedStocks->contains($approvedStock)) {
            $this->approvedStocks->removeElement($approvedStock);
            // set the owning side to null (unless already changed)
            if ($approvedStock->getApproveBy() === $this) {
                $approvedStock->setApproveBy(null);
            }
        }

        return $this;
    }

    /**
     * @return PayoutDetails
     */
    public function getPayoutDetails()
    {
        return $this->payoutDetails;
    }



    public function getIdentityVerified()
    {
        return $this->IdentityVerified;
    }

    public function setIdentityVerified( $IdentityVerified): self
    {
        $this->IdentityVerified = $IdentityVerified;

        return $this;
    }

    public function getIdentityFile(): ?string
    {
        return $this->IdentityFile;
    }

    public function setIdentityFile(?string $IdentityFile): self
    {
        $this->IdentityFile = $IdentityFile;

        return $this;
    }

    public function getCreateBy(): ?self
    {
        return $this->CreateBy;
    }

    public function setCreateBy(?self $CreateBy): self
    {
        $this->CreateBy = $CreateBy;

        return $this;
    }

    /**
     * @return Collection|self[]
     */
    public function getModels(): Collection
    {
        return $this->models;
    }

    public function addModel(self $model): self
    {
        if (!$this->models->contains($model)) {
            $this->models[] = $model;
            $model->setCreateBy($this);
        }

        return $this;
    }

    public function removeModel(self $model): self
    {
        if ($this->models->contains($model)) {
            $this->models->removeElement($model);
            // set the owning side to null (unless already changed)
            if ($model->getCreateBy() === $this) {
                $model->setCreateBy(null);
            }
        }

        return $this;
    }

    public function getModel(): ?Model
    {
        return $this->model;
    }

    public function setModel(?Model $model): self
    {
        $this->model = $model;

        // set (or unset) the owning side of the relation if necessary
        $newUser = $model === null ? null : $this;
        if ($newUser !== $model->getUser()) {
            $model->setUser($newUser);
        }

        return $this;
    }

    /**
     * @return Collection|Model[]
     */
    public function getCreatedModels(): Collection
    {
        return $this->createdModels;
    }

    public function addCreatedModel(Model $createdModel): self
    {
        if (!$this->createdModels->contains($createdModel)) {
            $this->createdModels[] = $createdModel;
            $createdModel->setCreatedBy($this);
        }

        return $this;
    }

    public function removeCreatedModel(Model $createdModel): self
    {
        if ($this->createdModels->contains($createdModel)) {
            $this->createdModels->removeElement($createdModel);
            // set the owning side to null (unless already changed)
            if ($createdModel->getCreatedBy() === $this) {
                $createdModel->setCreatedBy(null);
            }
        }

        return $this;
    }

    public function getFtpUser(): ?FtpUser
    {
        return $this->ftpUser;
    }

    public function setFtpUser(FtpUser $ftpUser): self
    {
        $this->ftpUser = $ftpUser;

        // set the owning side of the relation if necessary
        if ($this !== $ftpUser->getUser()) {
            $ftpUser->setUser($this);
        }

        return $this;
    }

    /**
     * @return Collection|MyModel[]
     */
    public function getMyModels(): Collection
    {
        return $this->myModels;
    }

    public function addMyModel(MyModel $myModel): self
    {
        if (!$this->myModels->contains($myModel)) {
            $this->myModels[] = $myModel;
            $myModel->setModel($this);
        }

        return $this;
    }

    public function removeMyModel(MyModel $myModel): self
    {
        if ($this->myModels->contains($myModel)) {
            $this->myModels->removeElement($myModel);
            // set the owning side to null (unless already changed)
            if ($myModel->getModel() === $this) {
                $myModel->setModel(null);
            }
        }

        return $this;
    }

    /**
     * @return Collection|MyModel[]
     */
    public function getMyContributors(): Collection
    {
        return $this->myContributors;
    }

    public function addMyContributor(MyModel $myContributor): self
    {
        if (!$this->myContributors->contains($myContributor)) {
            $this->myContributors[] = $myContributor;
            $myContributor->setContributor($this);
        }

        return $this;
    }

    public function removeMyContributor(MyModel $myContributor): self
    {
        if ($this->myContributors->contains($myContributor)) {
            $this->myContributors->removeElement($myContributor);
            // set the owning side to null (unless already changed)
            if ($myContributor->getContributor() === $this) {
                $myContributor->setContributor(null);
            }
        }

        return $this;
    }

    public function getPhoneNumber(): ?string
    {
        return $this->phoneNumber;
    }

    public function setPhoneNumber(?string $phoneNumber): self
    {
        $this->phoneNumber = $phoneNumber;

        return $this;
    }

    public function getAvatar(): ?string
    {
        return $this->Avatar;
    }

    public function setAvatar(?string $Avatar): self
    {
        $this->Avatar = $Avatar;

        return $this;
    }

    public function getCart(): ?Cart
    {
        return $this->cart;
    }

    public function setCart(Cart $cart): self
    {
        $this->cart = $cart;

        // set the owning side of the relation if necessary
        if ($this !== $cart->getBuyer()) {
            $cart->setBuyer($this);
        }

        return $this;
    }

    /**
     * @return Collection|Invoice[]
     */
    public function getCreatedInvoices(): Collection
    {
        return $this->createdInvoices;
    }

    public function addCreatedInvoice(Invoice $createdInvoice): self
    {
        if (!$this->createdInvoices->contains($createdInvoice)) {
            $this->createdInvoices[] = $createdInvoice;
            $createdInvoice->setCreateBy($this);
        }

        return $this;
    }

    public function removeCreatedInvoice(Invoice $createdInvoice): self
    {
        if ($this->createdInvoices->contains($createdInvoice)) {
            $this->createdInvoices->removeElement($createdInvoice);
            // set the owning side to null (unless already changed)
            if ($createdInvoice->getCreateBy() === $this) {
                $createdInvoice->setCreateBy(null);
            }
        }

        return $this;
    }

    /**
     * @return Collection|Payouts[]
     */
    public function getPayouts(): Collection
    {
        return $this->payouts;
    }

    public function addPayout(Payouts $payout): self
    {
        if (!$this->payouts->contains($payout)) {
            $this->payouts[] = $payout;
            $payout->setPayoutTo($this);
        }

        return $this;
    }

    public function removePayout(Payouts $payout): self
    {
        if ($this->payouts->contains($payout)) {
            $this->payouts->removeElement($payout);
            // set the owning side to null (unless already changed)
            if ($payout->getPayoutTo() === $this) {
                $payout->setPayoutTo(null);
            }
        }

        return $this;
    }

    public function getJoinedOn(): ?\DateTimeInterface
    {
        return $this->joinedOn;
    }

    public function setJoinedOn(?\DateTimeInterface $joinedOn): self
    {
        $this->joinedOn = $joinedOn;

        return $this;
    }

    public function getSecurityCode(): ?string
    {
        return $this->securityCode;
    }

    public function setSecurityCode(?string $securityCode): self
    {
        $this->securityCode = $securityCode;

        return $this;
    }

    /**
     * @return mixed
     */
    public function getRegistrationComplete()
    {
        return $this->registrationComplete;
    }

    /**
     * @param mixed $registrationComplete
     */
    public function setRegistrationComplete($registrationComplete): void
    {
        $this->registrationComplete = $registrationComplete;
    }

    public function getIsExclusive(): ?bool
    {
        return $this->is_exclusive;
    }

    public function setIsExclusive(?bool $is_exclusive): self
    {
        $this->is_exclusive = $is_exclusive;

        return $this;
    }

    public function getApprover(): ?self
    {
        return $this->approver;
    }

    public function setApprover(?self $approver): self
    {
        $this->approver = $approver;

        return $this;
    }

    public function getRejectReason(): ?string
    {
        return $this->rejectReason;
    }

    public function setRejectReason(?string $rejectReason): self
    {
        $this->rejectReason = $rejectReason;

        return $this;
    }

    public function getRejectedBy(): ?self
    {
        return $this->rejectedBy;
    }

    public function setRejectedBy(?self $rejectedBy): self
    {
        $this->rejectedBy = $rejectedBy;

        return $this;
    }

    public function getRejectedAt(): ?\DateTimeInterface
    {
        return $this->rejectedAt;
    }

    public function setRejectedAt(?\DateTimeInterface $rejectedAt): self
    {
        $this->rejectedAt = $rejectedAt;

        return $this;
    }

    public function getApprovedAt(): ?\DateTimeInterface
    {
        return $this->approvedAt;
    }

    public function setApprovedAt(?\DateTimeInterface $approvedAt): self
    {
        $this->approvedAt = $approvedAt;

        return $this;
    }

    public function getId(): ?int
    {
        return $this->id;
    }

    public function setPayoutDetails(?PayoutDetails $payoutDetails): self
    {
        $this->payoutDetails = $payoutDetails;

        // set (or unset) the owning side of the relation if necessary
        $newUser = null === $payoutDetails ? null : $this;
        if ($payoutDetails->getUser() !== $newUser) {
            $payoutDetails->setUser($newUser);
        }

        return $this;
    }

    public function getSuspendedMember(): ?bool
    {
        return $this->suspended_member;
    }

    public function setSuspendedMember(?bool $suspended_member): self
    {
        $this->suspended_member = $suspended_member;

        return $this;
    }

    public function getSuspensionReason(): ?string
    {
        return $this->suspension_reason;
    }

    public function setSuspensionReason(?string $suspension_reason): self
    {
        $this->suspension_reason = $suspension_reason;

        return $this;
    }

    public function getFacebookId(): ?int
    {
        return $this->facebookId;
    }

    public function setFacebookId(?int $facebookId): self
    {
        $this->facebookId = $facebookId;

        return $this;
    }

    /**
     * @return Collection|StockRecentViews[]
     */
    public function getStockRecentViews(): Collection
    {
        return $this->stockRecentViews;
    }

    public function addStockRecentView(StockRecentViews $stockRecentView): self
    {
        if (!$this->stockRecentViews->contains($stockRecentView)) {
            $this->stockRecentViews[] = $stockRecentView;
            $stockRecentView->setUser($this);
        }

        return $this;
    }

    public function removeStockRecentView(StockRecentViews $stockRecentView): self
    {
        if ($this->stockRecentViews->contains($stockRecentView)) {
            $this->stockRecentViews->removeElement($stockRecentView);
            // set the owning side to null (unless already changed)
            if ($stockRecentView->getUser() === $this) {
                $stockRecentView->setUser(null);
            }
        }

        return $this;
    }

    /**
     * @return Collection|EmailSubscription[]
     */
    public function getEmailSubscriptions(): Collection
    {
        return $this->emailSubscriptions;
    }

    public function addEmailSubscription(EmailSubscription $emailSubscription): self
    {
        if (!$this->emailSubscriptions->contains($emailSubscription)) {
            $this->emailSubscriptions[] = $emailSubscription;
            $emailSubscription->setUser($this);
        }

        return $this;
    }

    public function removeEmailSubscription(EmailSubscription $emailSubscription): self
    {
        if ($this->emailSubscriptions->contains($emailSubscription)) {
            $this->emailSubscriptions->removeElement($emailSubscription);
            // set the owning side to null (unless already changed)
            if ($emailSubscription->getUser() === $this) {
                $emailSubscription->setUser(null);
            }
        }

        return $this;
    }

    public function getTermsAgreement(): ?bool
    {
        return $this->termsAgreement;
    }

    public function setTermsAgreement(bool $termsAgreement): self
    {
        $this->termsAgreement = $termsAgreement;

        return $this;
    }

    public function getExclusiveTermination(): ?string
    {
        return $this->exclusive_termination;
    }

    public function setExclusiveTermination(?string $exclusive_termination): self
    {
        $this->exclusive_termination = $exclusive_termination;

        return $this;
    }

    public function getCaptchaCode()
    {
        return $this->captchaCode;
    }

    public function setCaptchaCode($captchaCode)
    {
        $this->captchaCode = $captchaCode;
    }


}

Youez - 2016 - github.com/yon3zu
LinuXploit